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
- s as TransactionService : The TransactionService object handling this transaction.
- p as TransactionPacket : The packet being served.
Returns
z as boolean: Always returns false.
endTransaction
Ends the transaction for the specified packet.
Syntax
void endTransaction(
s, p
)
Parameters
- s as TransactionService : The TransactionService object handling this transaction.
- p as TransactionPacket : The packet for this transaction.
startTransaction
Starts the transaction for the specified packet.
Syntax
void startTransaction(
s, p
)
Parameters
- s as TransactionService : The TransactionService object handling this transaction.
- p as TransactionPacket : The packet for this transaction.
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
- public data: The packet data.
- public errors: Variable use property.
- public is_finalized: Bit indicating whether the packet has been finalized.
- public is_open: Bit indicating whether the packet is open.
- public owner_id: Identifier of the registered object that owns the packet.
- public packet_id: The unique identifer of the packet.
- public packet_name: The name of the packet.
- public packet_state: Variable use property.
- public participant_count: Number of participants currently using this packet.
- public participants: Array of object identifiers that are participating in the transaction for this packet.
- public 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.
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
- b as boolean : Bit indicating whether the packet is blocked from being served during
setBlockServeTransaction
Specifies whether the packet should be served during serveTransaction.
Syntax
void setBlockServeTransaction(
b
)
Parameters
- b as boolean : Bit indicating whether the packet is blocked from being served during
setBlockStartTransaction
Specifies whether the packet should be served during startTransaction.
Syntax
void setBlockStartTransaction(
b
)
Parameters
- b as boolean : Bit indicating whether the packet is blocked from being served during
setServeType
Sets the packet serve type.
Syntax
void setServeType(
i
)
Parameters
- i as int : The type of service this packet will receive. 1 indicates the packet will be served untill all participants return true from
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
- public object_config (internal): Object API structure for storing sub structures: object_config.pointers and object_config.status.
- public object_id (internal): Unique instance identifier.
- public object_type (internal): The type of this object.
- public object_version (internal): Version of the object class.
- public ready_state (internal): Object load and execution state. Follows: 0 unitialized, 1 through 3 variant, 4 ready, 5 destroyed.
Method Index
- public addTransactionParticipant: Adds an object to participate with the specified TransactionPacket.
- public canRegister: Tests an object to determine if it can be registered.
- public closeTransaction: Closes the transaction represented by the specified TransactionPacket.
- public getObjectId: Returns the unique id of the object.
- public getObjectType: Returns the type of the object.
- public getObjectVersion: Returns the version of the object.
- public getPacket: Returns the specified TransactionPacket object.
- public getPacketByName: Returns the specified TransactionPacket object.
- public getPackets: Returns an array of TransactionPacket objects.
- public getPointers: Returns the object_config.pointers sub structure.
- public getReadyState: Returns the state of the object.
- public getRegisteredObjects: Returns an array of object identifiers that are registered with the TransactionService.
- public getRegisteredObjectsMap: Returns a hashmap of object identifiers and the index into the registered objects array.
- public getStatus: Returns the object_config.status sub structure.
- public isPacket: Returns true if the specified name exists.
- public isRegistered: Returns whether an object is registered..
- public openTransaction: Opens a new transaction and returns the TransactionPacket identifier.
- public register: Registers an object with the transaction service.
- public removeTransactionParticipant: Removes an object from participating with the specified TransactionPacket.
- public serveTransaction: Serves the specified TransactionPacket to its participants.
- public sigterm: Sends a termination signal to the service, and closes all open packets.
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
- o as TransactionParticipant : Object that is registered with the TransactionService.
- p as TransactionPacket : TransactionPacket with which the specified object should participate.
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
- o as object : Object to test whether or not it can be registered.
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
- i as String : Name of the TransactionPacket.
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
- i as int : Index of the TransactionPacket object..
Returns
e as TransactionPacket: XHTMLForm object.
getPacketByName
Returns the specified TransactionPacket object.
Syntax
e = getPacketByName(
n
)
Parameters
- n as String : Name of the element.
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
- i as variant : Name or index of the TransactionPacket object..
Returns
b as boolean: Bit indicating whether the specified object name exists.
isRegistered
Returns whether an object is registered..
Syntax
b = isRegistered(
o
)
Parameters
- o as object : Object to test whether or not it is registered.
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
- n as String : Name of the transaction.
- p as TransactionParticipant (optional): Parent object.
- d as variant (optional): Data associated with the transaction.
- f as function (optional): Function to invoke when transaction completes and the TransactionPacket is finalized.
Returns
i as String: Identifier of the new TransactionPacket.
register
Registers an object with the transaction service.
Syntax
b = register(
o
)
Parameters
- o as object : Object to register with the TransactionService.
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
- o as TransactionParticipant : Object that is registered with the TransactionService.
- p as TransactionPacket : TransactionPacket with which the specified object is participating.
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
- p as TransactionPacket : TransactionPacket with which the specified object is participating.
- i as String (optional): Identifier of the object that should act as the controller of the packet. Defaults to the packet owner.
- b as boolean (optional): Skip serving the packet to the controller.
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(
)