org.apache.activemq.ra
Class ActiveMQResourceAdapter
java.lang.Object
org.apache.activemq.ra.ActiveMQConnectionSupport
org.apache.activemq.ra.ActiveMQResourceAdapter
- All Implemented Interfaces:
- javax.resource.spi.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)
Methods inherited from class org.apache.activemq.ra.ActiveMQConnectionSupport |
createConnectionFactory, defaultValue, emptyToNull, getClientid, getDurableTopicPrefetch, getInfo, getInitialRedeliveryDelay, getInputStreamPrefetch, getMaximumRedeliveries, getMaximumRedeliveryDelay, getPassword, getQueueBrowserPrefetch, getQueuePrefetch, getRedeliveryBackOffMultiplier, getRedeliveryUseExponentialBackOff, getServerUrl, getTopicPrefetch, getUseInboundSession, getUserName, isUseInboundSessionEnabled, makeConnection, makeConnection, notEqual, setAllPrefetchValues, setClientid, setDurableTopicPrefetch, setInfo, setInitialRedeliveryDelay, setInputStreamPrefetch, setMaximumRedeliveries, setMaximumRedeliveryDelay, 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 |
ActiveMQResourceAdapter
public ActiveMQResourceAdapter()
start
public void start(javax.resource.spi.BootstrapContext bootstrapContext)
throws javax.resource.spi.ResourceAdapterInternalException
- Specified by:
start
in interface javax.resource.spi.ResourceAdapter
- Throws:
javax.resource.spi.ResourceAdapterInternalException
- See Also:
ResourceAdapter.start(javax.resource.spi.BootstrapContext)
makeConnection
public ActiveMQConnection makeConnection()
throws javax.jms.JMSException
- Throws:
javax.jms.JMSException
- See Also:
org.apache.activemq.ra.MessageResourceAdapter#makeConnection()
makeConnection
public ActiveMQConnection makeConnection(MessageActivationSpec activationSpec)
throws javax.jms.JMSException
- Specified by:
makeConnection
in interface MessageResourceAdapter
- Parameters:
activationSpec
-
- Throws:
javax.jms.JMSException
stop
public void stop()
- Specified by:
stop
in interface javax.resource.spi.ResourceAdapter
- See Also:
ResourceAdapter.stop()
getBootstrapContext
public javax.resource.spi.BootstrapContext getBootstrapContext()
- Specified by:
getBootstrapContext
in interface MessageResourceAdapter
- Returns:
- bootstrap context
- See Also:
MessageResourceAdapter.getBootstrapContext()
endpointActivation
public void endpointActivation(javax.resource.spi.endpoint.MessageEndpointFactory endpointFactory,
javax.resource.spi.ActivationSpec activationSpec)
throws javax.resource.ResourceException
- Specified by:
endpointActivation
in interface javax.resource.spi.ResourceAdapter
- Throws:
javax.resource.ResourceException
- See Also:
ResourceAdapter.endpointActivation(javax.resource.spi.endpoint.MessageEndpointFactory,
javax.resource.spi.ActivationSpec)
endpointDeactivation
public void endpointDeactivation(javax.resource.spi.endpoint.MessageEndpointFactory endpointFactory,
javax.resource.spi.ActivationSpec activationSpec)
- Specified by:
endpointDeactivation
in interface javax.resource.spi.ResourceAdapter
- See Also:
ResourceAdapter.endpointDeactivation(javax.resource.spi.endpoint.MessageEndpointFactory,
javax.resource.spi.ActivationSpec)
getXAResources
public javax.transaction.xa.XAResource[] getXAResources(javax.resource.spi.ActivationSpec[] activationSpecs)
throws javax.resource.ResourceException
- We only connect to one resource manager per ResourceAdapter instance, so
any ActivationSpec will return the same XAResource.
- Specified by:
getXAResources
in interface javax.resource.spi.ResourceAdapter
- Throws:
javax.resource.ResourceException
- See Also:
ResourceAdapter.getXAResources(javax.resource.spi.ActivationSpec[])
getBrokerXmlConfig
public java.lang.String getBrokerXmlConfig()
- Specified by:
getBrokerXmlConfig
in interface MessageResourceAdapter
- See Also:
MessageResourceAdapter.getBrokerXmlConfig()
setBrokerXmlConfig
public void setBrokerXmlConfig(java.lang.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(java.lang.Object o)
- Overrides:
equals
in class java.lang.Object
- See Also:
Object.equals(java.lang.Object)
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
- See Also:
Object.hashCode()
getConnectionFactory
public ActiveMQConnectionFactory getConnectionFactory()
setConnectionFactory
public void setConnectionFactory(ActiveMQConnectionFactory aConnectionFactory)
Copyright © 2005-2016. All Rights Reserved.