Packagecom.kaazing.gateway.jms.client.stomp
Classpublic class StompInitialContext

Provides a JNDI (Java Naming and Directory Interface) style lookup for ConnectionFactory and Destination objects.



Public Properties
 PropertyDefined by
  CONNECTION_TIMEOUT : String = "com.kaazing.gateway.jms.client.stomp.connectionTimeout"
[static] Time to wait on initial connection before closing in milliseconds
StompInitialContext
  PROVIDER_URL : String = "java.naming.provider.url"
[static] Gateway location for connections
StompInitialContext
  RECONNECT_ATTEMPTS_MAX : String = "com.kaazing.gateway.jms.client.stomp.reconnectAttemptsMax"
[static] Maximum number of reconnect attempts (default to infinite)
StompInitialContext
  RECONNECT_DELAY : String = "com.kaazing.gateway.jms.client.stomp.reconnectDelay"
[static] Time to wait between reconnect attempts in milliseconds
StompInitialContext
  SHUTDOWN_DELAY : String = "com.kaazing.gateway.jms.client.stomp.shutdownDelay"
[static] Time to wait for server to close socket after sending DISCONNECT before closing in milliseconds
StompInitialContext
Public Methods
 MethodDefined by
  
StompInitialContext(env:Dictionary)
Creates a new StompInitialContext

To create a new ConnectionFactory with a target Gateway URL, use the following:
var env:Dictionary = new Dictionary();
env[StompInitialContext.PROVIDER_URL] = "ws://localhost:8000/jms";
initialContext = new StompInitialContext(env);

var connectionFactory:ConnectionFactory =
  initialContext.lookup("ConnectionFactory") as ConnectionFactory;
var connection:Connection = connectionFactory.createConnection(username, password);
...

StompInitialContext
  
lookup(name:String):Object
Retrieves the named object.
StompInitialContext
Property detail
CONNECTION_TIMEOUTproperty
public static var CONNECTION_TIMEOUT:String = "com.kaazing.gateway.jms.client.stomp.connectionTimeout"

Time to wait on initial connection before closing in milliseconds

PROVIDER_URLproperty 
public static var PROVIDER_URL:String = "java.naming.provider.url"

Gateway location for connections

RECONNECT_ATTEMPTS_MAXproperty 
public static var RECONNECT_ATTEMPTS_MAX:String = "com.kaazing.gateway.jms.client.stomp.reconnectAttemptsMax"

Maximum number of reconnect attempts (default to infinite)

RECONNECT_DELAYproperty 
public static var RECONNECT_DELAY:String = "com.kaazing.gateway.jms.client.stomp.reconnectDelay"

Time to wait between reconnect attempts in milliseconds

SHUTDOWN_DELAYproperty 
public static var SHUTDOWN_DELAY:String = "com.kaazing.gateway.jms.client.stomp.shutdownDelay"

Time to wait for server to close socket after sending DISCONNECT before closing in milliseconds

Constructor detail
StompInitialContext()constructor
public function StompInitialContext(env:Dictionary)

Creates a new StompInitialContext

To create a new ConnectionFactory with a target Gateway URL, use the following:
var env:Dictionary = new Dictionary();
env[StompInitialContext.PROVIDER_URL] = "ws://localhost:8000/jms";
initialContext = new StompInitialContext(env);

var connectionFactory:ConnectionFactory =
  initialContext.lookup("ConnectionFactory") as ConnectionFactory;
var connection:Connection = connectionFactory.createConnection(username, password);
...

Parameters
env:Dictionary — the environment for initialization
Method detail
lookup()method
public function lookup(name:String):Object

Retrieves the named object. Throws an Error if the name is not bound. If name is "ConnectionFactory", returns a ConnectionFactory object that connects to the provider url (Gateway url) defined in the env properties passed to the StompInitialContext() constructor. Returns a Destination representing a topic or queue in the JMS provider. The following format is used for all topics and queues, regardless of the server format.
/topic/destination (Topic)
/queue/destination (Queue)

Use the Session interface to create Temporary Topics and Queues.

Parameters
name:String — The bound object to lookup

Returns
Object