Engine for Web Applications

org.cote.js.transaction

Class Index

static org.cote.js.transaction.TransactionService

version 1.9.18

Static instance of the TransactionServiceImpl class.

This class participates in the engine library.

static org.cote.js.transaction.TransactionParticipant

version 1.9.18

This static class describes the interface an object must expose to participate in the TransactionService. A participant must be registered with the ObjectRegistry.

This class participates in the engine library.

Index

Method Index

Methods

doTransaction

Processes the served transaction packet.

Syntax

z = doTransaction( s, p )

Parameters

Returns

z as boolean: Always returns false.

endTransaction

Ends the transaction for the specified packet.

Syntax

void endTransaction( s, p )

Parameters

startTransaction

Starts the transaction for the specified packet.

Syntax

void startTransaction( s, p )

Parameters

org.cote.js.transaction.TransactionPacket

version 1.9.18

This is an abstract class generated by the TransactionService. It has no public initializer or constructor.

This class participates in the engine library.

Index

Property Index

Method Index

Properties

data

The packet data.

Syntax

variant = object.data

object.data = variant

errors

Variable use property.

Syntax

int = object.errors

object.errors = int

is_finalized

Bit indicating whether the packet has been finalized.

Syntax

boolean = object.is_finalized

is_open

Bit indicating whether the packet is open.

Syntax

boolean = object.is_open

owner_id

Identifier of the registered object that owns the packet.

Syntax

String = object.owner_id

packet_id

The unique identifer of the packet.

Syntax

String = object.packet_id

packet_name

The name of the packet.

Syntax

String = object.packet_name

packet_state

Variable use property.

Syntax

int = object.packet_state

object.packet_state = int

participant_count

Number of participants currently using this packet.

Syntax

int = object.participant_count

participants

Array of object identifiers that are participating in the transaction for this packet.

Syntax

array = object.participants

serve_type

The type of service this packet will receive. 1 indicates the packet will be served untill all participants return true from doTransaction. 2 indicates the packet is only served once.

Syntax

int = object.serve_type

Methods

setBlockEndTransaction

Specifies whether the packet should be served during endTransaction.

Syntax

void setBlockEndTransaction( b )

Parameters

setBlockServeTransaction

Specifies whether the packet should be served during serveTransaction.

Syntax

void setBlockServeTransaction( b )

Parameters

setBlockStartTransaction

Specifies whether the packet should be served during startTransaction.

Syntax

void setBlockStartTransaction( b )

Parameters

setServeType

Sets the packet serve type.

Syntax

void setServeType( i )

Parameters

org.cote.js.transaction.TransactionServiceImpl

version 1.9.18

A class for managing communication between objects implementing the TransactionParticipant API, and using TransactionPacket objects.

This class participates in the engine library.

Index

Property Index

Method Index

Properties

object_config

Object API structure for storing sub structures: object_config.pointers and object_config.status.

Syntax

object = object.object_config

object_id

Unique instance identifier.

Syntax

String = object.object_id

object_type

The type of this object.

Syntax

String = object.object_type

object_version

Version of the object class.

Syntax

String = object.object_version

ready_state

Object load and execution state. Follows: 0 unitialized, 1 through 3 variant, 4 ready, 5 destroyed.

Syntax

int = object.ready_state

Methods

addTransactionParticipant

Adds an object to participate with the specified TransactionPacket.

Syntax

b = addTransactionParticipant( o, p )

Parameters

Returns

b as boolean: True if the object is participating with the packet, otherwise false.

canRegister

Tests an object to determine if it can be registered.

Syntax

b = canRegister( o )

Parameters

Returns

b as boolean: True if the object can be registered, otherwise false.

closeTransaction

Closes the transaction represented by the specified TransactionPacket.

Syntax

void closeTransaction( i )

Parameters

getObjectId

Returns the unique id of the object.

Syntax

i = getObjectId( )

Returns

i as String: The unique object instance id.

getObjectType

Returns the type of the object.

Syntax

t = getObjectType( )

Returns

t as String: The type of the object instance.

getObjectVersion

Returns the version of the object.

Syntax

v = getObjectVersion( )

Returns

v as String: The version of the object instance.

getPacket

Returns the specified TransactionPacket object.

Syntax

e = getPacket( i )

Parameters

Returns

e as TransactionPacket: XHTMLForm object.

getPacketByName

Returns the specified TransactionPacket object.

Syntax

e = getPacketByName( n )

Parameters

Returns

e as TransactionPacket: TransactionPacket object.

getPackets

Returns an array of TransactionPacket objects.

Syntax

a = getPackets( )

Returns

a as array: Array of TransactionPacket objects.

getPointers

Returns the object_config.pointers sub structure.

Syntax

o = getPointers( )

Returns

o as object: The object_config.pointers substructure.

getReadyState

Returns the state of the object.

Syntax

s = getReadyState( )

Returns

s as int: The object ready state.

getRegisteredObjects

Returns an array of object identifiers that are registered with the TransactionService.

Syntax

a = getRegisteredObjects( )

Returns

a as array: Array of object identifiers

getRegisteredObjectsMap

Returns a hashmap of object identifiers and the index into the registered objects array.

Syntax

a = getRegisteredObjectsMap( )

Returns

a as array: Hashmap of object identifiers

getStatus

Returns the object_config.status sub structure.

Syntax

o = getStatus( )

Returns

o as object: The object_config.status substructure.

isPacket

Returns true if the specified name exists.

Syntax

b = isPacket( i )

Parameters

Returns

b as boolean: Bit indicating whether the specified object name exists.

isRegistered

Returns whether an object is registered..

Syntax

b = isRegistered( o )

Parameters

Returns

b as boolean: True if the object is registered, otherwise false.

openTransaction

Opens a new transaction and returns the TransactionPacket identifier.

Syntax

i = openTransaction( n, p, d, f )

Parameters

Returns

i as String: Identifier of the new TransactionPacket.

register

Registers an object with the transaction service.

Syntax

b = register( o )

Parameters

Returns

b as boolean: True if the object was registered, otherwise false.

removeTransactionParticipant

Removes an object from participating with the specified TransactionPacket.

Syntax

b = removeTransactionParticipant( o, p )

Parameters

Returns

b as boolean: True if the object was removed from participating with the packet, otherwise false.

serveTransaction

Serves the specified TransactionPacket to its participants.

Syntax

b = serveTransaction( p, i, b )

Parameters

Returns

b as boolean: True if the packet was served, otherwise false.

sigterm

Sends a termination signal to the service, and closes all open packets.

Syntax

void sigterm( )