Class: JMSContextListener

JMSContextListener

Interface to be implemented to listen to JMS context outcome events. Methods of this interface are called during ConnectionFactory.createContext calls, as the processing of JMS context proceeds.
Note that it is not necessary to implement all of the interface methods, missing methods will not be called. Note that if the onContextCreated method is not implemented it will not be possible to use the created context in any way.

new JMSContextListener()

This is a dummy constructor not to be used in any case.

Method Summary

onContextCreated
Event handler that is called when the context is created.
onContextFailed
Event handler that is called if the context can't be created.
onLSClient
Event that will be invoked when the embedded LightstreamerClient instance has been created and initialized, but before creating the context.

Method Detail

onContextCreated(context)

Event handler that is called when the context is created. This method will never be called if a JMSContextListener#onContextFailed event was fired.
Parameters:
Name Type Description
context JMSContext The JMSContext instance representing the current JMS context.

onContextFailed(errorCode, errorMessage)

Event handler that is called if the context can't be created. The following error codes are used for specific error conditions on the JMS Extender:
  • -13: the JMS Extender configured hook denied acces to the specified user/password pair.
Other possible error codes are the reported in the LightstreamerClient event ClientListener#onServerError, see for more information.

This method will never be called if a JMSContextListener#onContextCreated event was fired.

Parameters:
Name Type Description
errorCode Number The code of the error.
errorMessage String The description of the error as sent by the Server.

onLSClient(client)

Event that will be invoked when the embedded LightstreamerClient instance has been created and initialized, but before creating the context.

This is the first event to be fired: it offers the possibility to further customize the LightstreamerClient instance before the connection is issued. It can also be used to attach listeners to the given instance. Note that this method is called synchronously inside the factory methods (i.e. it executes before the create*Context method ends).

Parameters:
Name Type Description
client external:LightstreamerClient The client instance that will be used to connect to the JMS Extender.