Package org.apache.activemq.ra
Class ActiveMQResourceAdapter
- java.lang.Object
-
- org.apache.activemq.ra.ActiveMQConnectionSupport
-
- org.apache.activemq.ra.ActiveMQResourceAdapter
-
- All Implemented Interfaces:
Serializable,ResourceAdapter,MessageResourceAdapter
public class ActiveMQResourceAdapter extends ActiveMQConnectionSupport implements Serializable, 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)- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.activemq.ra.ActiveMQConnectionSupport
log
-
-
Constructor Summary
Constructors Constructor Description ActiveMQResourceAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidendpointActivation(MessageEndpointFactory endpointFactory, ActivationSpec activationSpec)voidendpointDeactivation(MessageEndpointFactory endpointFactory, ActivationSpec activationSpec)booleanequals(Object o)BootstrapContextgetBootstrapContext()StringgetBrokerXmlConfig()ActiveMQConnectionFactorygetConnectionFactory()XAResource[]getXAResources(ActivationSpec[] activationSpecs)We only connect to one resource manager per ResourceAdapter instance, so any ActivationSpec will return the same XAResource.inthashCode()ActiveMQConnectionmakeConnection()ActiveMQConnectionmakeConnection(MessageActivationSpec activationSpec)voidsetBrokerXmlConfig(String brokerXmlConfig)Sets the XML configuration file used to configure the ActiveMQ broker via Spring if using embedded mode.voidsetConnectionFactory(ActiveMQConnectionFactory aConnectionFactory)voidstart(BootstrapContext bootstrapContext)voidstop()-
Methods inherited from class org.apache.activemq.ra.ActiveMQConnectionSupport
createConnectionFactory, defaultValue, emptyToNull, getClientid, getDurableTopicPrefetch, getInfo, getInitialRedeliveryDelay, getInputStreamPrefetch, getKeyStore, getKeyStoreKeyPassword, getKeyStorePassword, getMaximumRedeliveries, getMaximumRedeliveryDelay, getOptimizeDurableTopicPrefetch, getPassword, getQueueBrowserPrefetch, getQueuePrefetch, getRedeliveryBackOffMultiplier, getRedeliveryUseExponentialBackOff, getServerUrl, getTopicPrefetch, getTrustStore, getTrustStorePassword, getUseInboundSession, getUserName, getUseSessionArgs, isUseInboundSessionEnabled, isUseSessionArgs, makeConnection, makeConnection, notEqual, setAllPrefetchValues, setClientid, setDurableTopicPrefetch, setInfo, setInitialRedeliveryDelay, setKeyStore, setKeyStoreKeyPassword, setKeyStorePassword, setMaximumRedeliveries, setMaximumRedeliveryDelay, setOptimizeDurableTopicPrefetch, setPassword, setQueueBrowserPrefetch, setQueuePrefetch, setRedeliveryBackOffMultiplier, setRedeliveryUseExponentialBackOff, setServerUrl, setTopicPrefetch, setTrustStore, setTrustStorePassword, setUseInboundSession, setUserName, setUseSessionArgs
-
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
-
-
-
-
Method Detail
-
start
public void start(BootstrapContext bootstrapContext) throws ResourceAdapterInternalException
- Specified by:
startin interfaceResourceAdapter- Throws:
ResourceAdapterInternalException- See Also:
ResourceAdapter.start(javax.resource.spi.BootstrapContext)
-
makeConnection
public ActiveMQConnection makeConnection() throws JMSException
- Throws:
JMSException
-
makeConnection
public ActiveMQConnection makeConnection(MessageActivationSpec activationSpec) throws JMSException
- Specified by:
makeConnectionin interfaceMessageResourceAdapter- Parameters:
activationSpec-- Throws:
JMSException
-
stop
public void stop()
- Specified by:
stopin interfaceResourceAdapter- See Also:
ResourceAdapter.stop()
-
getBootstrapContext
public BootstrapContext getBootstrapContext()
- Specified by:
getBootstrapContextin interfaceMessageResourceAdapter- Returns:
- bootstrap context
- See Also:
MessageResourceAdapter.getBootstrapContext()
-
endpointActivation
public void endpointActivation(MessageEndpointFactory endpointFactory, ActivationSpec activationSpec) throws ResourceException
- Specified by:
endpointActivationin interfaceResourceAdapter- Throws:
ResourceException- See Also:
ResourceAdapter.endpointActivation(javax.resource.spi.endpoint.MessageEndpointFactory, javax.resource.spi.ActivationSpec)
-
endpointDeactivation
public void endpointDeactivation(MessageEndpointFactory endpointFactory, ActivationSpec 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:
getXAResourcesin interfaceResourceAdapter- Throws:
ResourceException- See Also:
ResourceAdapter.getXAResources(javax.resource.spi.ActivationSpec[])
-
getBrokerXmlConfig
public String getBrokerXmlConfig()
- Specified by:
getBrokerXmlConfigin interfaceMessageResourceAdapter- 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 offoo/bar.xmlwould be assumed to be on the classpath whereasfile:dir/file.xmlwould use the file system. Any valid URL string is supported.
-
equals
public boolean equals(Object o)
- Overrides:
equalsin classObject- See Also:
Object.equals(java.lang.Object)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classObject- See Also:
Object.hashCode()
-
getConnectionFactory
public ActiveMQConnectionFactory getConnectionFactory()
-
setConnectionFactory
public void setConnectionFactory(ActiveMQConnectionFactory aConnectionFactory)
-
-