Package org.apache.activemq.ra
Class ActiveMQResourceAdapter
java.lang.Object
org.apache.activemq.ra.ActiveMQConnectionSupport
org.apache.activemq.ra.ActiveMQResourceAdapter
- All Implemented Interfaces:
jakarta.resource.spi.ResourceAdapter,Serializable,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:
-
Field Summary
Fields inherited from class org.apache.activemq.ra.ActiveMQConnectionSupport
log -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidendpointActivation(jakarta.resource.spi.endpoint.MessageEndpointFactory endpointFactory, jakarta.resource.spi.ActivationSpec activationSpec) voidendpointDeactivation(jakarta.resource.spi.endpoint.MessageEndpointFactory endpointFactory, jakarta.resource.spi.ActivationSpec activationSpec) booleanjakarta.resource.spi.BootstrapContextorg.apache.activemq.ActiveMQConnectionFactorygetXAResources(jakarta.resource.spi.ActivationSpec[] activationSpecs) We only connect to one resource manager per ResourceAdapter instance, so any ActivationSpec will return the same XAResource.inthashCode()org.apache.activemq.ActiveMQConnectionorg.apache.activemq.ActiveMQConnectionmakeConnection(MessageActivationSpec activationSpec) voidsetBrokerXmlConfig(String brokerXmlConfig) Sets the XML configuration file used to configure the ActiveMQ broker via Spring if using embedded mode.voidsetConnectionFactory(org.apache.activemq.ActiveMQConnectionFactory aConnectionFactory) voidstart(jakarta.resource.spi.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, setUseSessionArgsMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.activemq.ra.MessageResourceAdapter
getInfo, makeConnection
-
Constructor Details
-
ActiveMQResourceAdapter
public ActiveMQResourceAdapter()
-
-
Method Details
-
start
public void start(jakarta.resource.spi.BootstrapContext bootstrapContext) throws jakarta.resource.spi.ResourceAdapterInternalException - Specified by:
startin interfacejakarta.resource.spi.ResourceAdapter- Throws:
jakarta.resource.spi.ResourceAdapterInternalException- See Also:
-
javax.resource.spi.ResourceAdapter#start(javax.resource.spi.BootstrapContext)
-
makeConnection
public org.apache.activemq.ActiveMQConnection makeConnection() throws jakarta.jms.JMSException- Throws:
jakarta.jms.JMSException
-
makeConnection
public org.apache.activemq.ActiveMQConnection makeConnection(MessageActivationSpec activationSpec) throws jakarta.jms.JMSException - Specified by:
makeConnectionin interfaceMessageResourceAdapter- Parameters:
activationSpec-- Throws:
jakarta.jms.JMSException
-
stop
public void stop()- Specified by:
stopin interfacejakarta.resource.spi.ResourceAdapter- See Also:
-
javax.resource.spi.ResourceAdapter#stop()
-
getBootstrapContext
public jakarta.resource.spi.BootstrapContext getBootstrapContext()- Specified by:
getBootstrapContextin interfaceMessageResourceAdapter- Returns:
- bootstrap context
- See Also:
-
endpointActivation
public void endpointActivation(jakarta.resource.spi.endpoint.MessageEndpointFactory endpointFactory, jakarta.resource.spi.ActivationSpec activationSpec) throws jakarta.resource.ResourceException - Specified by:
endpointActivationin interfacejakarta.resource.spi.ResourceAdapter- Throws:
jakarta.resource.ResourceException- See Also:
-
javax.resource.spi.ResourceAdapter#endpointActivation(javax.resource.spi.endpoint.MessageEndpointFactory, javax.resource.spi.ActivationSpec)
-
endpointDeactivation
public void endpointDeactivation(jakarta.resource.spi.endpoint.MessageEndpointFactory endpointFactory, jakarta.resource.spi.ActivationSpec activationSpec) - Specified by:
endpointDeactivationin interfacejakarta.resource.spi.ResourceAdapter- See Also:
-
javax.resource.spi.ResourceAdapter#endpointDeactivation(javax.resource.spi.endpoint.MessageEndpointFactory, javax.resource.spi.ActivationSpec)
-
getXAResources
public XAResource[] getXAResources(jakarta.resource.spi.ActivationSpec[] activationSpecs) throws jakarta.resource.ResourceException We only connect to one resource manager per ResourceAdapter instance, so any ActivationSpec will return the same XAResource.- Specified by:
getXAResourcesin interfacejakarta.resource.spi.ResourceAdapter- Throws:
jakarta.resource.ResourceException- See Also:
-
javax.resource.spi.ResourceAdapter#getXAResources(javax.resource.spi.ActivationSpec[])
-
getBrokerXmlConfig
- Specified by:
getBrokerXmlConfigin interfaceMessageResourceAdapter- See Also:
-
setBrokerXmlConfig
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
-
hashCode
public int hashCode() -
getConnectionFactory
public org.apache.activemq.ActiveMQConnectionFactory getConnectionFactory() -
setConnectionFactory
public void setConnectionFactory(org.apache.activemq.ActiveMQConnectionFactory aConnectionFactory)
-