org.activemq.ra
Class ActiveMQResourceAdapter

java.lang.Object
  extended byorg.activemq.ra.ActiveMQResourceAdapter
All Implemented Interfaces:
ResourceAdapter

public class ActiveMQResourceAdapter
extends Object
implements ResourceAdapter

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

Must override equals and hashCode (JCA spec 16.4)

Version:
$Revision: 1.2 $

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()
           
 String getClientid()
           
 String getEndpointWorkerType()
           
 ActiveMQConnectionRequestInfo getInfo()
           
 String getPassword()
           
 String getServerUrl()
           
 Boolean getUseEmbeddedBroker()
           
 Boolean getUseInboundSession()
           
 String getUserName()
           
 XAResource[] getXAResources(ActivationSpec[] activationSpecs)
          We only connect to one resource manager per ResourceAdapter instance, so any ActivationSpec will return the same XAResource.
 int hashCode()
           
 Boolean isUseEmbeddedBroker()
           
 org.activemq.ActiveMQConnection makeConnection()
          Return a connection using the default connection request info from the RAR deployment.
 org.activemq.ActiveMQConnection makeConnection(ActiveMQActivationSpec activationSpec)
           
 org.activemq.ActiveMQConnection makeConnection(ActiveMQConnectionRequestInfo crInfo)
          Return a connection using a specific connection request info.
 void setBrokerXmlConfig(String brokerXmlConfig)
          Sets the XML configuration file used to configure the ActiveMQ broker via Spring if using embedded mode.
 void setClientid(String clientid)
           
 void setEndpointWorkerType(String endpointWorkerType)
           
 void setPassword(String password)
           
 void setServerUrl(String url)
           
 void setUseEmbeddedBroker(Boolean useEmbeddedBroker)
           
 void setUseInboundSession(Boolean useInboundSession)
           
 void setUserName(String userid)
           
 void start(BootstrapContext bootstrapContext)
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

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 org.activemq.ActiveMQConnection makeConnection()
                                               throws JMSException
Return a connection using the default connection request info from the RAR deployment.

Throws:
JMSException

makeConnection

public org.activemq.ActiveMQConnection makeConnection(ActiveMQConnectionRequestInfo crInfo)
                                               throws JMSException
Return a connection using a specific connection request info.

Throws:
JMSException

makeConnection

public org.activemq.ActiveMQConnection makeConnection(ActiveMQActivationSpec activationSpec)
                                               throws JMSException
Parameters:
activationSpec -
Throws:
JMSException

stop

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

getBootstrapContext

public BootstrapContext getBootstrapContext()
Returns:

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[])

getClientid

public String getClientid()
Returns:

getPassword

public String getPassword()
Returns:

getServerUrl

public String getServerUrl()
Returns:

getUserName

public String getUserName()
Returns:

setClientid

public void setClientid(String clientid)
Parameters:
clientid -

setPassword

public void setPassword(String password)
Parameters:
password -

setServerUrl

public void setServerUrl(String url)
Parameters:
url -

setUserName

public void setUserName(String userid)
Parameters:
userid -

getEndpointWorkerType

public String getEndpointWorkerType()
Returns:
Returns the endpointWorkerType.

setEndpointWorkerType

public void setEndpointWorkerType(String endpointWorkerType)
Parameters:
endpointWorkerType - The endpointWorkerType to set.

getBrokerXmlConfig

public String 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.
See Also:
setUseEmbeddedBroker(Boolean)

isUseEmbeddedBroker

public Boolean isUseEmbeddedBroker()

setUseEmbeddedBroker

public void setUseEmbeddedBroker(Boolean useEmbeddedBroker)

getInfo

public ActiveMQConnectionRequestInfo getInfo()
Returns:
Returns the info.

equals

public boolean equals(Object o)

hashCode

public int hashCode()

getUseEmbeddedBroker

public Boolean getUseEmbeddedBroker()

getUseInboundSession

public Boolean getUseInboundSession()

setUseInboundSession

public void setUseInboundSession(Boolean useInboundSession)


Copyright © 2004-2007 Protique, Ltd.. All Rights Reserved.