org.codehaus.activemq.ra
Class ActiveMQResourceAdapter

java.lang.Object
  extended byorg.codehaus.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.12.2.1 $

Constructor Summary
ActiveMQResourceAdapter()
           
ActiveMQResourceAdapter(ConnectionFactory connectionFactory)
           
 
Method Summary
 void endpointActivation(MessageEndpointFactory endpointFactory, ActivationSpec activationSpec)
           
 void endpointDeactivation(MessageEndpointFactory endpointFactory, ActivationSpec activationSpec)
           
 boolean equals(Object o)
           
 BootstrapContext getBootstrapContext()
           
 String getClientid()
           
 String getEndpointWorkerType()
           
 ActiveMQConnectionRequestInfo getInfo()
           
 String getPassword()
           
 String getServerUrl()
           
 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()
           
 Connection makeConnection()
           
 Connection makeConnection(ActiveMQActivationSpec activationSpec)
           
 void setClientid(String clientid)
           
 void setEndpointWorkerType(String endpointWorkerType)
           
 void setPassword(String password)
           
 void setServerUrl(String url)
           
 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()

ActiveMQResourceAdapter

public ActiveMQResourceAdapter(ConnectionFactory connectionFactory)
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 Connection makeConnection()
                          throws JMSException
Throws:
JMSException

makeConnection

public Connection 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.

getInfo

public ActiveMQConnectionRequestInfo getInfo()
Returns:
Returns the info.

equals

public boolean equals(Object o)

hashCode

public int hashCode()


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