flex.messaging.services.messaging.adapters
Class JMSProxy

java.lang.Object
  extended by flex.messaging.services.messaging.adapters.JMSProxy
Direct Known Subclasses:
JMSConsumer

public abstract class JMSProxy
extends Object

The JMSProxy is the superclass for all producers and consumers on both topics and queues. This class contains shared behavior between producers and consumers.


Nested Class Summary
static class JMSProxy.ConnectionCredentials
          A static inner class for connection credentials that is passed to JMS connection factory when a JMS connection is created.
 
Constructor Summary
JMSProxy()
          Creates a new JMSProxy default default acknowledge mode of javax.jms.Session.AUTO_ACKNOWLEDGE.
 
Method Summary
 int getAcknowledgeMode()
          Returns the acknowledge mode used by the JMSProxy.
 JMSProxy.ConnectionCredentials getConnectionCredentials()
          Returns the connection credentials used while creating JMS connections.
 String getConnectionFactoryName()
          Returns the connection factory name.
 String getDestinationJndiName()
          Returns the JNDI name of the JMS destination that JMSProxy talks to.
 Hashtable getInitialContextEnvironment()
          Returns the initial-context-environment property.
 void initialize(JMSSettings settings)
          Initialize with settings from the JMS adapter.
 void setAcknowledgeMode(int acknowledgeMode)
          Sets the acknowledge mode used by the JMSProxy.
 void setConnectionCredentials(JMSProxy.ConnectionCredentials connectionCredentials)
          Sets the connection credentials.
 void setConnectionFactoryName(String connectionFactoryName)
          Sets the connection factory name.
 void setDestinationJndiName(String destinationJndiName)
          Sets the JNDI name of the JMS destination that JMSProxy talks to.
 void setInitialContextEnvironment(Hashtable env)
          Sets the initial-context-environment property.
 void start()
          Starts the JMSProxy.
 void stop()
          Stops the JMSProxy by stopping its associated session and connection.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JMSProxy

public JMSProxy()
Creates a new JMSProxy default default acknowledge mode of javax.jms.Session.AUTO_ACKNOWLEDGE.

Method Detail

initialize

public void initialize(JMSSettings settings)
Initialize with settings from the JMS adapter.

Parameters:
settings - JMS settings to use for initialization.

start

public void start()
           throws NamingException,
                  javax.jms.JMSException
Starts the JMSProxy. The default implementation verifies that JMSProxy is in a valid state to be started and then initializes JNDI context and connection factory for JMS. Subclasses should call super.start.

Throws:
NamingException - The thrown naming exception.
javax.jms.JMSException - The thrown JMS exception.

stop

public void stop()
Stops the JMSProxy by stopping its associated session and connection.


getAcknowledgeMode

public int getAcknowledgeMode()
Returns the acknowledge mode used by the JMSProxy.

Returns:
The acknowledge mode used by the JMSProxy.

setAcknowledgeMode

public void setAcknowledgeMode(int acknowledgeMode)
Sets the acknowledge mode used by the JMSProxy. Valid values are javax.jms.Session.AUTO_ACKNOWLEDGE, javax.jms.Session.CLIENT_ACKNOWLEDGE, javax.jms.Session.DUPS_OK_ACNOWLEDGE. This property is optional and defaults to javax.jms.Session.AUTO_ACKNOWLEDGE.

Parameters:
acknowledgeMode - An int representing the acknowledge mode used.

getConnectionFactoryName

public String getConnectionFactoryName()
Returns the connection factory name.

Returns:
The connection factory name.

setConnectionFactoryName

public void setConnectionFactoryName(String connectionFactoryName)
Sets the connection factory name. This property should not changed after startup.

Parameters:
connectionFactoryName - The connection factory name.

getConnectionCredentials

public JMSProxy.ConnectionCredentials getConnectionCredentials()
Returns the connection credentials used while creating JMS connections.

Returns:
The connection credentials used while creating JMS connections.

setConnectionCredentials

public void setConnectionCredentials(JMSProxy.ConnectionCredentials connectionCredentials)
Sets the connection credentials. Connections credentials are passed to JMS connection factory when a JMS connection is created.

Parameters:
connectionCredentials - The connection credentials.

getDestinationJndiName

public String getDestinationJndiName()
Returns the JNDI name of the JMS destination that JMSProxy talks to.

Returns:
The JNDI name of the JMS destination.

setDestinationJndiName

public void setDestinationJndiName(String destinationJndiName)
Sets the JNDI name of the JMS destination that JMSProxy talks to.

Parameters:
destinationJndiName - The JNDI name of the JMS destination.

getInitialContextEnvironment

public Hashtable getInitialContextEnvironment()
Returns the initial-context-environment property.

Returns:
a Hashtable of the initial-context-environment.

setInitialContextEnvironment

public void setInitialContextEnvironment(Hashtable env)
Sets the initial-context-environment property. This property is optional. This property should be change after startup.

Parameters:
env - A Hashtable of the initial-context-environment.


Copyright © 2008 Adobe Systems Inc. All Rights Reserved.

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/blazeds/1/javadoc/flex/messaging/services/messaging/adapters/JMSProxy.html