flex.messaging.services.messaging.adapters
Class JMSAdapter

java.lang.Object
  extended by flex.management.ManageableComponent
      extended by flex.messaging.services.ServiceAdapter
          extended by flex.messaging.services.messaging.adapters.JMSAdapter
All Implemented Interfaces:
Manageable, FlexComponent, FlexConfigurable, flex.messaging.services.messaging.adapters.JMSConfigConstants

public class JMSAdapter
extends ServiceAdapter
implements flex.messaging.services.messaging.adapters.JMSConfigConstants

This adapter for the MessageService integrates Flex messaging with Java Message Service destinations.


Field Summary
 
Fields inherited from class flex.messaging.services.ServiceAdapter
LOG_CATEGORY
 
Fields inherited from interface flex.messaging.services.messaging.adapters.JMSConfigConstants
ACKNOWLEDGE_MODE, CONNECTION_FACTORY, DEFAULT_DESTINATION_TYPE, DELIVERY_MODE, DESTINATION_JNDI_NAME, DESTINATION_NAME, DESTINATION_TYPE, MAX_PRODUCERS, MESSAGE_PRIORITY, MESSAGE_TYPE, TIME_TO_LIVE, TRANSACTION_MODE
 
Constructor Summary
JMSAdapter()
          Constructs an unmanaged JMSAdapter instance.
JMSAdapter(boolean enableManagement)
          Constructs a JMSAdapter instance.
 
Method Summary
 AsyncMessage convertToFlexMessage(javax.jms.Message jmsMessage, flex.messaging.services.messaging.adapters.JMSConsumer consumer)
          Convert from a javax.jms.Message type to a flex.messaging.messages.AsyncMessage type.
 JMSSettings getJMSSettings()
          Gets the JMSSettings of the JMSAdapter.
 int getQueueConsumerCount()
          Returns the count of queue consumers managed by this adapter.
 String[] getQueueConsumerIds()
          Returns the ids of all queue consumers.
 int getQueueProducerCount()
          Returns the count of queue producers currently managed by this adapter.
 int getTopicConsumerCount()
          Returns the count of topic consumers currently managed by this adapter.
 String[] getTopicConsumerIds()
          Returns the ids of all topic consumers.
 int getTopicProducerCount()
          Returns the count of topic producers currently managed by this adapter.
 boolean handlesSubscriptions()
          Returns true if the adapter performs custom subscription management.
 void initialize(String id, ConfigMap properties)
          Initializes the JMSAdapter with the properties.
 Object invoke(Message message)
          Publish a message to this adapter's JMS destination.
 Object manage(CommandMessage commandMessage)
          Handle a CommandMessage sent by this adapter's service.
 void onJmsConnectionException(javax.jms.JMSException e, flex.messaging.services.messaging.adapters.JMSProxy jmsProxy)
          Handle a failure on the javax.jms.Connection used by a JMSConsumer.
 void onMessage(javax.jms.Message jmsMessage, flex.messaging.services.messaging.adapters.JMSConsumer consumer)
          Receive a message propagated by a JMSConsumer.
 void removeConsumer(String clientId)
          Removes (unsubscribes) the specified consumer.
 void setDestination(Destination destination)
          Casts the Destination into MessageDestination and calls super.setDestination
 void setJMSSettings(JMSSettings jmsSettings)
          Sets the JMSSettings of the JMSAdapter.
 void stop()
          Stops the adapter.
 
Methods inherited from class flex.messaging.services.ServiceAdapter
getAdapterState, getDestination, setAdapterState, start
 
Methods inherited from class flex.management.ManageableComponent
getControl, getId, getParent, isManaged, isStarted, isValid, setControl, setId, setManaged, setParent
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JMSAdapter

public JMSAdapter()
Constructs an unmanaged JMSAdapter instance.


JMSAdapter

public JMSAdapter(boolean enableManagement)
Constructs a JMSAdapter instance.

Parameters:
enableManagement - true if the JMSAdapter has a corresponding MBean control for management; otherwise false.
Method Detail

initialize

public void initialize(String id,
                       ConfigMap properties)
Initializes the JMSAdapter with the properties.

Specified by:
initialize in interface FlexConfigurable
Overrides:
initialize in class ManageableComponent
Parameters:
properties - Properties for the ServiceAdapter.
id - Id of the ManageableComponent.

stop

public void stop()
Stops the adapter.

Specified by:
stop in interface FlexComponent
Overrides:
stop in class ServiceAdapter

setDestination

public void setDestination(Destination destination)
Casts the Destination into MessageDestination and calls super.setDestination

Overrides:
setDestination in class ServiceAdapter
Parameters:
destination -

getJMSSettings

public JMSSettings getJMSSettings()
Gets the JMSSettings of the JMSAdapter.

Returns:
JMSSettings of the JMSAdapter.

setJMSSettings

public void setJMSSettings(JMSSettings jmsSettings)
Sets the JMSSettings of the JMSAdapter.

Parameters:
jmsSettings - JMSSettings of the JMSAdapter.

invoke

public Object invoke(Message message)
Publish a message to this adapter's JMS destination.

Specified by:
invoke in class ServiceAdapter
Parameters:
message - the message as sent by the client intended for this adapter
Returns:
the body of the acknowledge message (or null if there is no body)
See Also:
Message, AsyncMessage

manage

public Object manage(CommandMessage commandMessage)
Handle a CommandMessage sent by this adapter's service.

Overrides:
manage in class ServiceAdapter
See Also:
CommandMessage, AsyncMessage

handlesSubscriptions

public boolean handlesSubscriptions()
Description copied from class: ServiceAdapter
Returns true if the adapter performs custom subscription management. The default return value is false, and subclasses should override this method as necessary.

Overrides:
handlesSubscriptions in class ServiceAdapter

onMessage

public void onMessage(javax.jms.Message jmsMessage,
                      flex.messaging.services.messaging.adapters.JMSConsumer consumer)
Receive a message propagated by a JMSConsumer.


convertToFlexMessage

public AsyncMessage convertToFlexMessage(javax.jms.Message jmsMessage,
                                         flex.messaging.services.messaging.adapters.JMSConsumer consumer)
Convert from a javax.jms.Message type to a flex.messaging.messages.AsyncMessage type. Only javax.jms.TextMessage and javax.jms.ObjectMessage are supported.


onJmsConnectionException

public void onJmsConnectionException(javax.jms.JMSException e,
                                     flex.messaging.services.messaging.adapters.JMSProxy jmsProxy)
Handle a failure on the javax.jms.Connection used by a JMSConsumer.


getTopicProducerCount

public int getTopicProducerCount()
Returns the count of topic producers currently managed by this adapter.

Returns:
The count of topic producers currently managed by this adapter.

getTopicConsumerCount

public int getTopicConsumerCount()
Returns the count of topic consumers currently managed by this adapter.

Returns:
The count of topic consumers currently managed by this adapter.

getTopicConsumerIds

public String[] getTopicConsumerIds()
Returns the ids of all topic consumers.

Returns:
The ids of all topic consumers.

getQueueProducerCount

public int getQueueProducerCount()
Returns the count of queue producers currently managed by this adapter.

Returns:
The count of queue producers currently managed by this adapter.

getQueueConsumerCount

public int getQueueConsumerCount()
Returns the count of queue consumers managed by this adapter.

Returns:
The count of queue consumers managed by this adapter.

getQueueConsumerIds

public String[] getQueueConsumerIds()
Returns the ids of all queue consumers.

Returns:
The ids of all queue consumers.

removeConsumer

public void removeConsumer(String clientId)
Removes (unsubscribes) the specified consumer.

Parameters:
clientId - The identifier for the consumer to remove.


Copyright © 2007 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/livecycle/es/sdkHelp/programmer/lcdsjavadoc/flex/messaging/services/messaging/adapters/JMSAdapter.html