org.apache.activemq.ra
Class ActiveMQResourceAdapter

java.lang.Object
  extended by org.apache.activemq.ra.ActiveMQConnectionSupport
      extended by org.apache.activemq.ra.ActiveMQResourceAdapter
All Implemented Interfaces:
ResourceAdapter, MessageResourceAdapter

public class ActiveMQResourceAdapter
extends ActiveMQConnectionSupport
implements MessageResourceAdapter

Knows how to connect to one ActiveMQ server. It can then activate endpoints and deliver messages to those end points using the connection configure in the resource adapter.

Must override equals and hashCode (JCA spec 16.4)


Field Summary
 
Fields inherited from class org.apache.activemq.ra.ActiveMQConnectionSupport
log
 
Constructor Summary
ActiveMQResourceAdapter()
           
 
Method Summary
 void endpointActivation(MessageEndpointFactory endpointFactory, ActivationSpec activationSpec)
           
 void endpointDeactivation(MessageEndpointFactory endpointFactory, ActivationSpec activationSpec)
           
 boolean equals(Object o)
           
 BootstrapContext getBootstrapContext()
           
 String getBrokerXmlConfig()
           
 ActiveMQConnectionFactory getConnectionFactory()
           
 XAResource[] getXAResources(ActivationSpec[] activationSpecs)
          We only connect to one resource manager per ResourceAdapter instance, so any ActivationSpec will return the same XAResource.
 int hashCode()
           
 ActiveMQConnection makeConnection()
           
 ActiveMQConnection makeConnection(MessageActivationSpec activationSpec)
           
 void setBrokerXmlConfig(String brokerXmlConfig)
          Sets the XML configuration file used to configure the ActiveMQ broker via Spring if using embedded mode.
 void setConnectionFactory(ActiveMQConnectionFactory aConnectionFactory)
           
 void start(BootstrapContext bootstrapContext)
           
 void stop()
           
 
Methods inherited from class org.apache.activemq.ra.ActiveMQConnectionSupport
createConnectionFactory, defaultValue, emptyToNull, getClientid, getDurableTopicPrefetch, getInfo, getInitialRedeliveryDelay, getInputStreamPrefetch, getMaximumRedeliveries, getMaximumRedeliveryDelay, getOptimizeDurableTopicPrefetch, getPassword, getQueueBrowserPrefetch, getQueuePrefetch, getRedeliveryBackOffMultiplier, getRedeliveryUseExponentialBackOff, getServerUrl, getTopicPrefetch, getUseInboundSession, getUserName, isUseInboundSessionEnabled, makeConnection, makeConnection, notEqual, setAllPrefetchValues, setClientid, setDurableTopicPrefetch, setInfo, setInitialRedeliveryDelay, setInputStreamPrefetch, setMaximumRedeliveries, setMaximumRedeliveryDelay, setOptimizeDurableTopicPrefetch, setPassword, setQueueBrowserPrefetch, setQueuePrefetch, setRedeliveryBackOffMultiplier, setRedeliveryUseExponentialBackOff, setServerUrl, setTopicPrefetch, setUseInboundSession, setUserName
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.activemq.ra.MessageResourceAdapter
getInfo, makeConnection
 

Constructor Detail

ActiveMQResourceAdapter

public ActiveMQResourceAdapter()
Method Detail

start

public void start(BootstrapContext bootstrapContext)
           throws ResourceAdapterInternalException
Specified by:
start in interface ResourceAdapter
Throws:
ResourceAdapterInternalException
See Also:
ResourceAdapter.start(javax.resource.spi.BootstrapContext)

makeConnection

public ActiveMQConnection makeConnection()
                                  throws JMSException
Throws:
JMSException
See Also:
org.apache.activemq.ra.MessageResourceAdapter#makeConnection()

makeConnection

public ActiveMQConnection makeConnection(MessageActivationSpec activationSpec)
                                  throws JMSException
Specified by:
makeConnection in interface MessageResourceAdapter
Parameters:
activationSpec -
Throws:
JMSException

stop

public void stop()
Specified by:
stop in interface ResourceAdapter
See Also:
ResourceAdapter.stop()

getBootstrapContext

public BootstrapContext getBootstrapContext()
Specified by:
getBootstrapContext in interface MessageResourceAdapter
Returns:
bootstrap context
See Also:
MessageResourceAdapter.getBootstrapContext()

endpointActivation

public void endpointActivation(MessageEndpointFactory endpointFactory,
                               ActivationSpec activationSpec)
                        throws ResourceException
Specified by:
endpointActivation in interface ResourceAdapter
Throws:
ResourceException
See Also:
ResourceAdapter.endpointActivation(javax.resource.spi.endpoint.MessageEndpointFactory, javax.resource.spi.ActivationSpec)

endpointDeactivation

public void endpointDeactivation(MessageEndpointFactory endpointFactory,
                                 ActivationSpec activationSpec)
Specified by:
endpointDeactivation in interface ResourceAdapter
See Also:
ResourceAdapter.endpointDeactivation(javax.resource.spi.endpoint.MessageEndpointFactory, javax.resource.spi.ActivationSpec)

getXAResources

public XAResource[] getXAResources(ActivationSpec[] activationSpecs)
                            throws ResourceException
We only connect to one resource manager per ResourceAdapter instance, so any ActivationSpec will return the same XAResource.

Specified by:
getXAResources in interface ResourceAdapter
Throws:
ResourceException
See Also:
ResourceAdapter.getXAResources(javax.resource.spi.ActivationSpec[])

getBrokerXmlConfig

public String getBrokerXmlConfig()
Specified by:
getBrokerXmlConfig in interface MessageResourceAdapter
See Also:
MessageResourceAdapter.getBrokerXmlConfig()

setBrokerXmlConfig

public void setBrokerXmlConfig(String brokerXmlConfig)
Sets the XML configuration file used to configure the ActiveMQ broker via Spring if using embedded mode.

Parameters:
brokerXmlConfig - is the filename which is assumed to be on the classpath unless a URL is specified. So a value of foo/bar.xml would be assumed to be on the classpath whereas file:dir/file.xml would use the file system. Any valid URL string is supported.

equals

public boolean equals(Object o)
Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Overrides:
hashCode in class Object
See Also:
Object.hashCode()

getConnectionFactory

public ActiveMQConnectionFactory getConnectionFactory()

setConnectionFactory

public void setConnectionFactory(ActiveMQConnectionFactory aConnectionFactory)


Copyright © 2005-2013 The Apache Software Foundation. All Rights Reserved.