org.apache.activemq.ra
Class ActiveMQConnectionSupport

java.lang.Object
  extended by org.apache.activemq.ra.ActiveMQConnectionSupport
Direct Known Subclasses:
ActiveMQManagedConnectionFactory, ActiveMQResourceAdapter

public class ActiveMQConnectionSupport
extends Object

Abstract base class providing support for creating physical connections to an ActiveMQ instance.


Field Summary
protected  Logger log
           
 
Constructor Summary
ActiveMQConnectionSupport()
           
 
Method Summary
protected  ActiveMQConnectionFactory createConnectionFactory(ActiveMQConnectionRequestInfo connectionRequestInfo)
          Creates a factory for obtaining physical connections to an Active MQ broker.
protected  String defaultValue(String value, String defaultValue)
           
protected  String emptyToNull(String value)
           
 String getClientid()
           
 Integer getDurableTopicPrefetch()
           
 ActiveMQConnectionRequestInfo getInfo()
          Gets the connection request information.
 Long getInitialRedeliveryDelay()
           
 Integer getInputStreamPrefetch()
           
 Integer getMaximumRedeliveries()
           
 Long getMaximumRedeliveryDelay()
           
 Integer getOptimizeDurableTopicPrefetch()
           
 String getPassword()
           
 Integer getQueueBrowserPrefetch()
           
 Integer getQueuePrefetch()
           
 Double getRedeliveryBackOffMultiplier()
           
 Boolean getRedeliveryUseExponentialBackOff()
           
 String getServerUrl()
           
 Integer getTopicPrefetch()
           
 Boolean getUseInboundSession()
           
 String getUserName()
           
 boolean isUseInboundSessionEnabled()
           
 ActiveMQConnection makeConnection(ActiveMQConnectionRequestInfo connectionRequestInfo)
          Creates a new physical connection to an Active MQ broker identified by given connection request information.
 ActiveMQConnection makeConnection(ActiveMQConnectionRequestInfo connectionRequestInfo, ActiveMQConnectionFactory connectionFactory)
          Creates a new physical connection to an Active MQ broker using a given connection factory and credentials supplied in connection request information.
protected  boolean notEqual(Object o1, Object o2)
           
 void setAllPrefetchValues(Integer i)
           
 void setClientid(String clientid)
           
 void setDurableTopicPrefetch(Integer durableTopicPrefetch)
           
protected  void setInfo(ActiveMQConnectionRequestInfo connectionRequestInfo)
          Sets the connection request information as a whole.
 void setInitialRedeliveryDelay(Long value)
           
 void setInputStreamPrefetch(Integer inputStreamPrefetch)
           
 void setMaximumRedeliveries(Integer value)
           
 void setMaximumRedeliveryDelay(Long value)
           
 void setOptimizeDurableTopicPrefetch(Integer optimizeDurableTopicPrefetch)
           
 void setPassword(String password)
           
 void setQueueBrowserPrefetch(Integer queueBrowserPrefetch)
           
 void setQueuePrefetch(Integer queuePrefetch)
           
 void setRedeliveryBackOffMultiplier(Double value)
           
 void setRedeliveryUseExponentialBackOff(Boolean value)
           
 void setServerUrl(String url)
           
 void setTopicPrefetch(Integer topicPrefetch)
           
 void setUseInboundSession(Boolean useInboundSession)
           
 void setUserName(String userid)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected Logger log
Constructor Detail

ActiveMQConnectionSupport

public ActiveMQConnectionSupport()
Method Detail

createConnectionFactory

protected ActiveMQConnectionFactory createConnectionFactory(ActiveMQConnectionRequestInfo connectionRequestInfo)
Creates a factory for obtaining physical connections to an Active MQ broker. The factory is configured with the given configuration information.

Parameters:
connectionRequestInfo - the configuration request information
Returns:
the connection factory
Throws:
IllegalArgumentException - if the server URL given in the configuration information is not a valid URL

makeConnection

public ActiveMQConnection makeConnection(ActiveMQConnectionRequestInfo connectionRequestInfo)
                                  throws JMSException
Creates a new physical connection to an Active MQ broker identified by given connection request information.

Parameters:
connectionRequestInfo - the connection request information identifying the broker and any required connection parameters, e.g. username/password
Returns:
the physical connection
Throws:
JMSException - if the connection could not be established

makeConnection

public ActiveMQConnection makeConnection(ActiveMQConnectionRequestInfo connectionRequestInfo,
                                         ActiveMQConnectionFactory connectionFactory)
                                  throws JMSException
Creates a new physical connection to an Active MQ broker using a given connection factory and credentials supplied in connection request information.

Parameters:
connectionRequestInfo - the connection request information containing the credentials to use for the connection request
Returns:
the physical connection
Throws:
JMSException - if the connection could not be established

getInfo

public ActiveMQConnectionRequestInfo getInfo()
Gets the connection request information.

Returns:
the connection request information

setInfo

protected void setInfo(ActiveMQConnectionRequestInfo connectionRequestInfo)
Sets the connection request information as a whole.

Parameters:
connectionRequestInfo - the connection request information

notEqual

protected boolean notEqual(Object o1,
                           Object o2)

emptyToNull

protected String emptyToNull(String value)

defaultValue

protected String defaultValue(String value,
                              String defaultValue)

getClientid

public String getClientid()
Returns:
client id

setClientid

public void setClientid(String clientid)
Parameters:
clientid -

getPassword

public String getPassword()
Returns:
password

setPassword

public void setPassword(String password)
Parameters:
password -

getServerUrl

public String getServerUrl()
Returns:
server URL

setServerUrl

public void setServerUrl(String url)
Parameters:
url -

getUserName

public String getUserName()
Returns:
user name

setUserName

public void setUserName(String userid)
Parameters:
userid -

getDurableTopicPrefetch

public Integer getDurableTopicPrefetch()
Returns:
durable topic prefetch

setOptimizeDurableTopicPrefetch

public void setOptimizeDurableTopicPrefetch(Integer optimizeDurableTopicPrefetch)
Parameters:
optimizeDurableTopicPrefetch -

getOptimizeDurableTopicPrefetch

public Integer getOptimizeDurableTopicPrefetch()
Returns:
durable topic prefetch

setDurableTopicPrefetch

public void setDurableTopicPrefetch(Integer durableTopicPrefetch)
Parameters:
durableTopicPrefetch -

getInitialRedeliveryDelay

public Long getInitialRedeliveryDelay()
Returns:
initial redelivery delay

setInitialRedeliveryDelay

public void setInitialRedeliveryDelay(Long value)
Parameters:
value -

getMaximumRedeliveryDelay

public Long getMaximumRedeliveryDelay()
Returns:
initial redelivery delay

setMaximumRedeliveryDelay

public void setMaximumRedeliveryDelay(Long value)
Parameters:
value -

getInputStreamPrefetch

public Integer getInputStreamPrefetch()
Returns:
input stream prefetch

setInputStreamPrefetch

public void setInputStreamPrefetch(Integer inputStreamPrefetch)
Parameters:
inputStreamPrefetch -

getMaximumRedeliveries

public Integer getMaximumRedeliveries()
Returns:
maximum redeliveries

setMaximumRedeliveries

public void setMaximumRedeliveries(Integer value)
Parameters:
value -

getQueueBrowserPrefetch

public Integer getQueueBrowserPrefetch()
Returns:
queue browser prefetch

setQueueBrowserPrefetch

public void setQueueBrowserPrefetch(Integer queueBrowserPrefetch)
Parameters:
queueBrowserPrefetch -

getQueuePrefetch

public Integer getQueuePrefetch()
Returns:
queue prefetch

setQueuePrefetch

public void setQueuePrefetch(Integer queuePrefetch)
Parameters:
queuePrefetch -

getRedeliveryBackOffMultiplier

public Double getRedeliveryBackOffMultiplier()
Returns:
redelivery backoff multiplier

setRedeliveryBackOffMultiplier

public void setRedeliveryBackOffMultiplier(Double value)
Parameters:
value -

getRedeliveryUseExponentialBackOff

public Boolean getRedeliveryUseExponentialBackOff()
Returns:
redelivery use exponential backoff

setRedeliveryUseExponentialBackOff

public void setRedeliveryUseExponentialBackOff(Boolean value)
Parameters:
value -

getTopicPrefetch

public Integer getTopicPrefetch()
Returns:
topic prefetch

setTopicPrefetch

public void setTopicPrefetch(Integer topicPrefetch)
Parameters:
topicPrefetch -

setAllPrefetchValues

public void setAllPrefetchValues(Integer i)
Parameters:
i -

isUseInboundSessionEnabled

public boolean isUseInboundSessionEnabled()
Returns:
use inbound session enabled

getUseInboundSession

public Boolean getUseInboundSession()
Returns:
use inbound session

setUseInboundSession

public void setUseInboundSession(Boolean useInboundSession)
Parameters:
useInboundSession -


Copyright © 2005–2013 The Apache Software Foundation. All rights reserved.