Engine for Web Applications

org.cote.js.message

Class Index

static org.cote.js.message.MessageService

version 1.9.18

Instance of MessageService.

This class participates in the engine library.

org.cote.js.message.MessageServiceImpl

version 1.9.18

Service for sending messages, and sending and receiving publication broadcasts.

This class participates in the engine library.

Index

Object Index

Property Index

Method Index

Objects

MessageObject

Object published to onsendmessage subscribers when the sendMessage method is invoked.

Properties

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

_delayPublish

End action for a delayed publication. Cached message is sent directly on to publication. Method is private and should not be directly referenced.

Syntax

void _delayPublish( i )

Parameters

_publish

Publishes the specified data to registered subscribers. Method is private and should not be directly referenced.

Syntax

void _publish( e, v )

Parameters

clearEntries

Clears message entries.

Syntax

void clearEntries( )

flush

Clears delayed delivery cache.

Syntax

void flush( )

getDeliveryDelay

Returns the delay in milliseconds between publication and delivery.

Syntax

d = getDeliveryDelay( )

Returns

d as int: Delay in milliseconds between publication and delivery.

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.

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.

getStatus

Returns the object_config.status sub structure.

Syntax

o = getStatus( )

Returns

o as object: The object_config.status substructure.

publish

Publishes the specified data to registered subscribers. If delayed delivery is in effect, caches the message data and sends it after the preset delay in milliseconds.

Syntax

void publish( e, v )

Parameters

sendMessage

Sends the specified message as a MessageObject to all onsendmessage subscribers.

Syntax

o = sendMessage( d, s, p )

Parameters

Returns

o as object: The MessageObject created for this message.

setDeliveryDelay

Sets the delay in milliseconds between publication and delivery.

Syntax

void setDeliveryDelay( d )

Parameters

setReportThreshold

Sets the report threshold for sendMessage.

Syntax

void setReportThreshold( level )

Parameters

sigterm

Termination signal indicating the message service should stop processing messages and subscriptions, and be prepared for destruction.

Syntax

void sigterm( )

subscribe

Subscribes an object to receive message publications for the specified publication name.

Syntax

void subscribe( o, e, f, v )

Parameters

unsubscribe

Unsubscribes an object from receiving message publications for the specified publication name.

Syntax

b = unsubscribe( o, e, f )

Parameters

Returns

b as boolean: Returns true if unsubscribed, false otherwise.