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 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, 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:
start
in 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:
makeConnection
in interfaceMessageResourceAdapter
- Parameters:
activationSpec
-- Throws:
JMSException
-
stop
public void stop()
- Specified by:
stop
in interfaceResourceAdapter
- See Also:
ResourceAdapter.stop()
-
getBootstrapContext
public BootstrapContext getBootstrapContext()
- Specified by:
getBootstrapContext
in interfaceMessageResourceAdapter
- Returns:
- bootstrap context
- See Also:
MessageResourceAdapter.getBootstrapContext()
-
endpointActivation
public void endpointActivation(MessageEndpointFactory endpointFactory, ActivationSpec activationSpec) throws ResourceException
- Specified by:
endpointActivation
in 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:
getXAResources
in interfaceResourceAdapter
- Throws:
ResourceException
- See Also:
ResourceAdapter.getXAResources(javax.resource.spi.ActivationSpec[])
-
getBrokerXmlConfig
public String getBrokerXmlConfig()
- Specified by:
getBrokerXmlConfig
in 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.xml
would be assumed to be on the classpath whereasfile:dir/file.xml
would use the file system. Any valid URL string is supported.
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classObject
- See Also:
Object.equals(java.lang.Object)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classObject
- See Also:
Object.hashCode()
-
getConnectionFactory
public ActiveMQConnectionFactory getConnectionFactory()
-
setConnectionFactory
public void setConnectionFactory(ActiveMQConnectionFactory aConnectionFactory)
-
-