Purpose: Base class extending RemoteConnection for broadcasting RCM protocols: JMS and Oc4jJGroups.
Description: Defines lifecycle states and most of the methods, as well as exception processing and info logging.
| Modifier and Type | Field and Description |
|---|---|
| protected String | |
| protected Object[] | |
| protected Object[] | |
| protected RemoteCommandManager | |
| protected String | |
| public static final String | |
| public static final String | |
| public static final String | |
| protected String |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| protected boolean | areAllResourcesFreedOnClose()
INTERNAL: Indicates whether all the resources used by connection are freed after close method returns. |
| public void | close()
Overrides org. |
| protected abstract void | |
| protected void | |
| public Object | executeCommand(Command command)
Implements abstract org. |
| public Object | executeCommand(byte[] command)
Implements abstract org. |
| protected abstract Object | |
| protected void | failDeserializeMessage(String messageId, Exception exception)
INTERNAL: Call this message in case there is failure to extract the object (to be passed to processReceivedObject) from the message. |
| protected Object[] | |
| protected Object[] | |
| public String | |
| public String | |
| public boolean | |
| public boolean | |
| public boolean | |
| protected void | logDebugAfterPublish(Object[] debugInfo, String messageId)
INTERNAL: Called from executeCommandInternal to log debugInfo right after sending the message. |
| protected Object[] | logDebugBeforePublish(String messageId)
INTERNAL: Called from executeCommandInternal to log debugInfo right before sending the message. |
| protected void | logDebugOnReceiveMessage(String messageId)
INTERNAL: Called when a message is received to log debugInfo: { toString(), messageId }. |
| protected void | processReceivedObject(Object object, String messageId)
INTERNAL: Process the object extracted from the received message. |
| protected boolean | Returns: booleanINTERNAL: Return whether a BroadcastConnection should check a ServiceId against its own ServiceId to avoid the processing of Commands with the same ServiceId. |
| public String | toString()
Overrides org. |
| displayString | back to summary |
|---|---|
| protected String displayString | |
| info | back to summary |
|---|---|
| protected Object[] info | |
| infoExt | back to summary |
|---|---|
| protected Object[] infoExt | |
| rcm | back to summary |
|---|---|
| protected RemoteCommandManager rcm | |
| state | back to summary |
|---|---|
| protected String state | |
| STATE_ACTIVE | back to summary |
|---|---|
| public static final String STATE_ACTIVE | |
| STATE_CLOSED | back to summary |
|---|---|
| public static final String STATE_CLOSED | |
| STATE_CLOSING | back to summary |
|---|---|
| public static final String STATE_CLOSING | |
| topicName | back to summary |
|---|---|
| protected String topicName | |
| BroadcastRemoteConnection | back to summary |
|---|---|
| protected BroadcastRemoteConnection(RemoteCommandManager rcm) | |
| areAllResourcesFreedOnClose | back to summary |
|---|---|
| protected boolean areAllResourcesFreedOnClose() INTERNAL: Indicates whether all the resources used by connection are freed after close method returns. Usually that's the case. However in case of local (listening) JMSTopicRemoteConnection close merely indicates to the listening thread that it should free TopicConnection and exit. Note that it may take a while: the listening thread waits until subscriber.receive method either returns a message or throws an exception. | |
| close | back to summary |
|---|---|
| public void close() Overrides org. INTERNAL: This method is called when connection in no longer used and it's resources should be freed. As soon as this method is called the state is CLOSING. Usually the state is CLOSED just before the method returns, but there are some special cases (see comment to areAllResourcesFreedOnClose method) when the state is still CLOSING after the method returns.
| |
| closeInternal | back to summary |
|---|---|
| protected abstract void closeInternal() throws Exception INTERNAL: This method is called by close method. This method usually (but not always see comment to areAllResourcesFreedOnClose method) frees all the resources. | |
| createDisplayString | back to summary |
|---|---|
| protected void createDisplayString() INTERNAL: | |
| executeCommand | back to summary |
|---|---|
| public Object executeCommand(Command command) throws CommunicationException Implements abstract org. INTERNAL: Publish the remote command. The result of execution is returned. This method is used only by external (publishing) connection.
| |
| executeCommand | back to summary |
|---|---|
| public Object executeCommand(byte[] command) throws CommunicationException Implements abstract org. INTERNAL: Publish the remote command. The result of execution is returned. This method is used only by external (publishing) connection.
| |
| executeCommandInternal | back to summary |
|---|---|
| protected abstract Object executeCommandInternal(Object command) throws Exception INTERNAL: Publish the remote command. The result of execution is returned. This method is used only by external (publishing) connection. | |
| failDeserializeMessage | back to summary |
|---|---|
| protected void failDeserializeMessage(String messageId, Exception exception) INTERNAL: Call this message in case there is failure to extract the object (to be passed to processReceivedObject) from the message. Pass to this method debugInfo created by logDebugOnReceiveMessage method. This method is used by local (listening) connection only. | |
| getInfo | back to summary |
|---|---|
| protected Object[] getInfo() INTERNAL: | |
| getInfoExt | back to summary |
|---|---|
| protected Object[] getInfoExt() INTERNAL: | |
| getState | back to summary |
|---|---|
| public String getState() INTERNAL: State of the connection. | |
| getTopicName | back to summary |
|---|---|
| public String getTopicName() INTERNAL: | |
| isActive | back to summary |
|---|---|
| public boolean isActive() INTERNAL: Connection is open for business. | |
| isClosed | back to summary |
|---|---|
| public boolean isClosed() INTERNAL: Connection is closed - all resources were freed. | |
| isClosing | back to summary |
|---|---|
| public boolean isClosing() INTERNAL: close method has been called. | |
| logDebugAfterPublish | back to summary |
|---|---|
| protected void logDebugAfterPublish(Object[] debugInfo, String messageId) INTERNAL: Called from executeCommandInternal to log debugInfo right after sending the message. Only call this method in case logDebugBeforePublish returned non-null this is indication that debug logging is enabled. Pass to this method debugInfo returned by logDebugBeforePublish. Need to pass messageId only in case it has changed since logDebugBeforePublish: some broadcasting protocols (JMS) don't generate messageId until the message is published. | |
| logDebugBeforePublish | back to summary |
|---|---|
| protected Object[] logDebugBeforePublish(String messageId) INTERNAL: Called from executeCommandInternal to log debugInfo right before sending the message. Returns array {toString(), messageId }. In case messageId is null returns getInfoExt() avoiding creation of a new array. | |
| logDebugOnReceiveMessage | back to summary |
|---|---|
| protected void logDebugOnReceiveMessage(String messageId) INTERNAL: Called when a message is received to log debugInfo: { toString(), messageId }. This method is used by local (listening) connection only. | |
| processReceivedObject | back to summary |
|---|---|
| protected void processReceivedObject(Object object, String messageId) INTERNAL: Process the object extracted from the received message. Pass to this method messageInfo created by logDebugOnReceiveMessage method. This method is used by local (listening) connection only. | |
| shouldCheckServiceId | back to summary |
|---|---|
| protected boolean shouldCheckServiceId() INTERNAL: Return whether a BroadcastConnection should check a ServiceId against its own ServiceId to avoid the processing of Commands with the same ServiceId.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides org. INTERNAL:
| |