|
|||||||||
| Home >> All >> org >> [ activemq overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.activemq
Class ActiveMQConnectionFactory

java.lang.Objectorg.activemq.jndi.JNDIBaseStorable
org.activemq.ActiveMQConnectionFactory
- All Implemented Interfaces:
- javax.jms.ConnectionFactory, org.activemq.jndi.JNDIStorableInterface, javax.jms.QueueConnectionFactory, javax.naming.Referenceable, org.activemq.service.Service, org.activemq.management.StatsCapable, javax.jms.TopicConnectionFactory
- Direct Known Subclasses:
- ActiveMQXAConnectionFactory
- public class ActiveMQConnectionFactory
- extends org.activemq.jndi.JNDIBaseStorable
- implements javax.jms.ConnectionFactory, javax.jms.QueueConnectionFactory, javax.jms.TopicConnectionFactory, org.activemq.service.Service, org.activemq.management.StatsCapable
- extends org.activemq.jndi.JNDIBaseStorable
A ConnectionFactory is an an Administed object, and is used for creating Connections.
This class also implements QueueConnectionFactory and TopicConnectionFactory and is an Administered object. You can use this connection to create both QueueConnections and TopicConnections.
- Version:
- $Revision: 1.2 $
| Fields inherited from class org.activemq.jndi.JNDIBaseStorable |
|
| Constructor Summary | |
ActiveMQConnectionFactory()
Default Constructor for ActiveMQConnectionFactory |
|
ActiveMQConnectionFactory(org.activemq.broker.BrokerContainer container)
Constructs a javax.jms.ConnectionFactory with an already configured and started org.activemq.broker.BrokerContainer ready for use in embedded mode. |
|
ActiveMQConnectionFactory(org.activemq.broker.BrokerContainer container,
java.lang.String brokerURL)
Constructs a javax.jms.ConnectionFactory with an already configured and started org.activemq.broker.BrokerContainer ready for use in embedded mode and the brokerURL connection. |
|
ActiveMQConnectionFactory(java.lang.String brokerURL)
|
|
ActiveMQConnectionFactory(java.lang.String userName,
java.lang.String password,
java.lang.String brokerURL)
|
|
| Method Summary | |
protected void |
buildFromProperties(java.util.Properties props)
Set the properties that will represent the instance in JNDI |
protected org.activemq.broker.BrokerConnector |
createBrokerConnector(java.lang.String url)
|
protected org.activemq.broker.BrokerContainerFactory |
createBrokerContainerFactory()
|
javax.jms.Connection |
createConnection()
Create a JMS Connection |
javax.jms.Connection |
createConnection(java.lang.String userName,
java.lang.String password)
|
protected java.lang.String |
createMulticastClientID()
Creates the clientID for the multicast client (used to dispatch local messages over a multicast bus) |
javax.jms.QueueConnection |
createQueueConnection()
Create a JMS QueueConnection |
javax.jms.QueueConnection |
createQueueConnection(java.lang.String userName,
java.lang.String password)
|
javax.jms.TopicConnection |
createTopicConnection()
Create a JMS TopicConnection |
javax.jms.TopicConnection |
createTopicConnection(java.lang.String userName,
java.lang.String password)
|
protected org.activemq.transport.TransportChannel |
createTransportChannel(java.lang.String theURLString)
Factory method to create a TransportChannel from a URL |
protected java.net.URI |
createURI(java.lang.String uri)
|
protected java.net.URI |
createURI(java.lang.String protocol,
java.net.URI uri)
|
protected org.activemq.transport.TransportChannel |
ensureMulticastChannelIsAvailable(java.net.URI remoteLocation,
org.activemq.transport.TransportChannel channel,
org.activemq.broker.BrokerConnector brokerConnector,
boolean created)
|
protected org.activemq.transport.TransportChannel |
ensureServerIsAvailable(java.net.URI remoteLocation,
org.activemq.transport.TransportChannel channel,
org.activemq.broker.BrokerConnector brokerConnector,
boolean created)
|
private void |
ensureVmServerIsAvailable(org.activemq.transport.TransportChannel channel,
org.activemq.broker.BrokerConnector brokerConnector)
|
protected boolean |
getBoolean(java.util.Properties props,
java.lang.String key)
Helper method to return the property value as a boolean flag |
protected boolean |
getBoolean(java.util.Properties props,
java.lang.String key,
boolean defaultValue)
Helper method to return the property value as a boolean flag |
org.activemq.broker.BrokerContainer |
getBrokerContainer()
|
org.activemq.broker.BrokerContainerFactory |
getBrokerContainerFactory()
|
org.activemq.broker.BrokerContext |
getBrokerContext()
Returns the context used to store broker containers and connectors which defaults to using the singleton |
java.lang.String |
getBrokerName()
The name of the broker to use if creating an embedded broker |
java.lang.String |
getBrokerName(java.lang.String url)
The name of the broker to use if creating an embedded broker |
java.lang.String |
getBrokerURL()
|
java.lang.String |
getBrokerXmlConfig()
|
java.lang.String |
getClientID()
|
protected org.activemq.broker.BrokerContainer |
getContainer(java.lang.String url,
java.lang.String name)
|
org.activemq.broker.Broker |
getEmbeddedBroker()
|
org.activemq.management.JMSStatsImpl |
getFactoryStats()
|
int |
getMessageCompressionLimit()
|
int |
getMessageCompressionStrategy()
|
int |
getMessageFragmentationLimit()
|
java.lang.String |
getPassword()
|
ActiveMQPrefetchPolicy |
getPrefetchPolicy()
Allows the prefetch policy to be configured |
org.activemq.management.StatsImpl |
getStats()
|
java.lang.String |
getUserName()
|
org.activemq.io.WireFormat |
getWireFormat()
|
boolean |
isCachingEnabled()
|
boolean |
isCopyMessageOnSend()
|
boolean |
isDisableTimeStampsByDefault()
|
boolean |
isDoMessageCompression()
|
boolean |
isDoMessageFragmentation()
|
boolean |
isInternalConnection()
|
boolean |
isJ2EEcompliant()
|
boolean |
isOptimizedMessageDispatch()
|
boolean |
isPrepareMessageBodyOnSend()
Causes pre-serialization of messages before send By default this is on |
boolean |
isQuickClose()
|
boolean |
isTurboBoost()
|
boolean |
isUseAsyncSend()
|
boolean |
isUseEmbeddedBroker()
Is an embedded broker used by this connection factory |
(package private) void |
onConnectionClose(ActiveMQConnection connection)
Called when a connection is closed so that we can shut down any embedded brokers cleanly |
(package private) void |
onConnectionCreate(ActiveMQConnection connection)
|
protected void |
populateProperties(java.util.Properties props)
Initialize the instance from properties stored in JNDI |
static void |
registerBroker(java.lang.String theURLString,
org.activemq.broker.BrokerConnector brokerConnector)
|
void |
setBrokerContainerFactory(org.activemq.broker.BrokerContainerFactory brokerContainerFactory)
|
void |
setBrokerContext(org.activemq.broker.BrokerContext brokerContext)
|
void |
setBrokerName(java.lang.String brokerName)
|
void |
setBrokerURL(java.lang.String brokerURL)
|
void |
setBrokerXmlConfig(java.lang.String brokerXmlConfig)
Sets the XML configuration file used to configure the ActiveMQ broker via Spring if using embedded mode. |
void |
setCachingEnabled(boolean cachingEnabled)
|
void |
setClientID(java.lang.String clientID)
|
void |
setCopyMessageOnSend(boolean copyMessageOnSend)
|
void |
setDisableTimeStampsByDefault(boolean disableTimeStampsByDefault)
|
void |
setDoMessageCompression(boolean doMessageCompression)
|
void |
setDoMessageFragmentation(boolean doMessageFragmentation)
|
void |
setInternalConnection(boolean internalConnection)
|
void |
setJ2EEcompliant(boolean ecompliant)
|
void |
setMessageCompressionLimit(int messageCompressionLimit)
|
void |
setMessageCompressionStrategy(int messageCompressionStrategy)
|
void |
setMessageFragmentationLimit(int messageFragmentationLimit)
|
void |
setOptimizedMessageDispatch(boolean optimizedMessageDispatch)
|
void |
setPassword(java.lang.String password)
|
void |
setPrefetchPolicy(ActiveMQPrefetchPolicy prefetchPolicy)
Sets the prefetch policy |
void |
setPrepareMessageBodyOnSend(boolean prePrepareMessageOnSend)
Causes pre-serialization of messages before send By default this is on |
void |
setQuickClose(boolean quickClose)
|
void |
setTurboBoost(boolean value)
Set this flag for fast throughput! |
void |
setUseAsyncSend(boolean useAsyncSend)
|
void |
setUseEmbeddedBroker(boolean useEmbeddedBroker)
Allows embedded brokers to be associated with a connection factory |
void |
setUserName(java.lang.String userName)
|
void |
setWireFormat(java.lang.String format)
set the WireFormat by name - e.g. |
void |
setWireFormat(org.activemq.io.WireFormat wireFormat)
Allows a custom wire format to be used; otherwise the default Java wire format is used which is designed for minimum size and maximum speed on the Java platform |
void |
start()
Called to start the service |
void |
stop()
A hook to allow any embedded JMS Broker's to be closed down |
static void |
unregisterBroker(java.lang.String theURLString)
|
| Methods inherited from class org.activemq.jndi.JNDIBaseStorable |
getProperties, getReference, setProperties |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
log
private static final org.apache.commons.logging.Log log
brokerContext
private org.activemq.broker.BrokerContext brokerContext
brokerContainerFactory
private org.activemq.broker.BrokerContainerFactory brokerContainerFactory
brokerContainer
protected org.activemq.broker.BrokerContainer brokerContainer
userName
protected java.lang.String userName
password
protected java.lang.String password
brokerURL
protected java.lang.String brokerURL
clientID
protected java.lang.String clientID
brokerName
protected java.lang.String brokerName
useEmbeddedBroker
private boolean useEmbeddedBroker
useAsyncSend
protected boolean useAsyncSend
- Should we use an async send for persistent non transacted messages ?
disableTimeStampsByDefault
protected boolean disableTimeStampsByDefault
J2EEcompliant
protected boolean J2EEcompliant
startedEmbeddedBrokers
private java.util.List startedEmbeddedBrokers
stats
private org.activemq.management.JMSStatsImpl stats
wireFormat
private org.activemq.io.WireFormat wireFormat
idGenerator
private org.activemq.util.IdGenerator idGenerator
connectionCount
private int connectionCount
brokerXmlConfig
private java.lang.String brokerXmlConfig
doMessageCompression
protected boolean doMessageCompression
messageCompressionLimit
protected int messageCompressionLimit
messageCompressionLevel
protected int messageCompressionLevel
messageCompressionStrategy
protected int messageCompressionStrategy
doMessageFragmentation
protected boolean doMessageFragmentation
messageFragmentationLimit
protected int messageFragmentationLimit
cachingEnabled
protected boolean cachingEnabled
prepareMessageBodyOnSend
protected boolean prepareMessageBodyOnSend
quickClose
protected boolean quickClose
internalConnection
protected boolean internalConnection
optimizedMessageDispatch
protected boolean optimizedMessageDispatch
copyMessageOnSend
protected boolean copyMessageOnSend
prefetchPolicy
private ActiveMQPrefetchPolicy prefetchPolicy
| Constructor Detail |
ActiveMQConnectionFactory
public ActiveMQConnectionFactory()
- Default Constructor for ActiveMQConnectionFactory
ActiveMQConnectionFactory
public ActiveMQConnectionFactory(java.lang.String brokerURL)
ActiveMQConnectionFactory
public ActiveMQConnectionFactory(java.lang.String userName, java.lang.String password, java.lang.String brokerURL)
ActiveMQConnectionFactory
public ActiveMQConnectionFactory(org.activemq.broker.BrokerContainer container)
- Constructs a javax.jms.ConnectionFactory with an already configured and started org.activemq.broker.BrokerContainer
ready for use in embedded mode.
ActiveMQConnectionFactory
public ActiveMQConnectionFactory(org.activemq.broker.BrokerContainer container, java.lang.String brokerURL)
- Constructs a javax.jms.ConnectionFactory with an already configured and started org.activemq.broker.BrokerContainer
ready for use in embedded mode and the brokerURL connection.
| Method Detail |
getStats
public org.activemq.management.StatsImpl getStats()
- Specified by:
getStatsin interfaceorg.activemq.management.StatsCapable
getFactoryStats
public org.activemq.management.JMSStatsImpl getFactoryStats()
getBrokerURL
public java.lang.String getBrokerURL()
setBrokerURL
public void setBrokerURL(java.lang.String brokerURL)
getClientID
public java.lang.String getClientID()
setClientID
public void setClientID(java.lang.String clientID)
getPassword
public java.lang.String getPassword()
setPassword
public void setPassword(java.lang.String password)
getUserName
public java.lang.String getUserName()
setUserName
public void setUserName(java.lang.String userName)
isUseEmbeddedBroker
public boolean isUseEmbeddedBroker()
- Is an embedded broker used by this connection factory
setUseEmbeddedBroker
public void setUseEmbeddedBroker(boolean useEmbeddedBroker)
- Allows embedded brokers to be associated with a connection factory
getBrokerName
public java.lang.String getBrokerName()
- The name of the broker to use if creating an embedded broker
getBrokerName
public java.lang.String getBrokerName(java.lang.String url)
- The name of the broker to use if creating an embedded broker
setBrokerName
public void setBrokerName(java.lang.String brokerName)
isUseAsyncSend
public boolean isUseAsyncSend()
setUseAsyncSend
public void setUseAsyncSend(boolean useAsyncSend)
getWireFormat
public org.activemq.io.WireFormat getWireFormat()
getPrefetchPolicy
public ActiveMQPrefetchPolicy getPrefetchPolicy()
- Allows the prefetch policy to be configured
setPrefetchPolicy
public void setPrefetchPolicy(ActiveMQPrefetchPolicy prefetchPolicy)
- Sets the prefetch policy
setTurboBoost
public void setTurboBoost(boolean value)
- Set this flag for fast throughput!
Enables asynchronous sending of messages and disables timestamps by default
isTurboBoost
public boolean isTurboBoost()
isOptimizedMessageDispatch
public boolean isOptimizedMessageDispatch()
setOptimizedMessageDispatch
public void setOptimizedMessageDispatch(boolean optimizedMessageDispatch)
isDisableTimeStampsByDefault
public boolean isDisableTimeStampsByDefault()
setDisableTimeStampsByDefault
public void setDisableTimeStampsByDefault(boolean disableTimeStampsByDefault)
isJ2EEcompliant
public boolean isJ2EEcompliant()
setJ2EEcompliant
public void setJ2EEcompliant(boolean ecompliant)
isInternalConnection
public boolean isInternalConnection()
setInternalConnection
public void setInternalConnection(boolean internalConnection)
isQuickClose
public boolean isQuickClose()
setQuickClose
public void setQuickClose(boolean quickClose)
isDoMessageCompression
public boolean isDoMessageCompression()
setDoMessageCompression
public void setDoMessageCompression(boolean doMessageCompression)
isDoMessageFragmentation
public boolean isDoMessageFragmentation()
setDoMessageFragmentation
public void setDoMessageFragmentation(boolean doMessageFragmentation)
getMessageCompressionLimit
public int getMessageCompressionLimit()
setMessageCompressionLimit
public void setMessageCompressionLimit(int messageCompressionLimit)
getMessageCompressionStrategy
public int getMessageCompressionStrategy()
setMessageCompressionStrategy
public void setMessageCompressionStrategy(int messageCompressionStrategy)
getMessageFragmentationLimit
public int getMessageFragmentationLimit()
setMessageFragmentationLimit
public void setMessageFragmentationLimit(int messageFragmentationLimit)
isCachingEnabled
public boolean isCachingEnabled()
setCachingEnabled
public void setCachingEnabled(boolean cachingEnabled)
isPrepareMessageBodyOnSend
public boolean isPrepareMessageBodyOnSend()
- Causes pre-serialization of messages before send
By default this is on
setPrepareMessageBodyOnSend
public void setPrepareMessageBodyOnSend(boolean prePrepareMessageOnSend)
- Causes pre-serialization of messages before send
By default this is on
isCopyMessageOnSend
public boolean isCopyMessageOnSend()
setCopyMessageOnSend
public void setCopyMessageOnSend(boolean copyMessageOnSend)
setWireFormat
public void setWireFormat(org.activemq.io.WireFormat wireFormat)
- Allows a custom wire format to be used; otherwise the default Java wire format is used
which is designed for minimum size and maximum speed on the Java platform
setWireFormat
public void setWireFormat(java.lang.String format) throws javax.jms.JMSException
- set the WireFormat by name - e.g. 'default','amqpfast' etc.
getBrokerXmlConfig
public java.lang.String getBrokerXmlConfig()
getBrokerContainer
public org.activemq.broker.BrokerContainer getBrokerContainer()
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.
getBrokerContainerFactory
public org.activemq.broker.BrokerContainerFactory getBrokerContainerFactory() throws javax.jms.JMSException
setBrokerContainerFactory
public void setBrokerContainerFactory(org.activemq.broker.BrokerContainerFactory brokerContainerFactory)
getBrokerContext
public org.activemq.broker.BrokerContext getBrokerContext()
- Returns the context used to store broker containers and connectors which defaults
to using the singleton
setBrokerContext
public void setBrokerContext(org.activemq.broker.BrokerContext brokerContext)
createConnection
public javax.jms.Connection createConnection() throws javax.jms.JMSException
- Create a JMS Connection
- Specified by:
createConnectionin interfacejavax.jms.ConnectionFactory
createConnection
public javax.jms.Connection createConnection(java.lang.String userName, java.lang.String password) throws javax.jms.JMSException
- Specified by:
createConnectionin interfacejavax.jms.ConnectionFactory
createQueueConnection
public javax.jms.QueueConnection createQueueConnection() throws javax.jms.JMSException
- Create a JMS QueueConnection
- Specified by:
createQueueConnectionin interfacejavax.jms.QueueConnectionFactory
createQueueConnection
public javax.jms.QueueConnection createQueueConnection(java.lang.String userName, java.lang.String password) throws javax.jms.JMSException
- Specified by:
createQueueConnectionin interfacejavax.jms.QueueConnectionFactory
createTopicConnection
public javax.jms.TopicConnection createTopicConnection() throws javax.jms.JMSException
- Create a JMS TopicConnection
- Specified by:
createTopicConnectionin interfacejavax.jms.TopicConnectionFactory
createTopicConnection
public javax.jms.TopicConnection createTopicConnection(java.lang.String userName, java.lang.String password) throws javax.jms.JMSException
- Specified by:
createTopicConnectionin interfacejavax.jms.TopicConnectionFactory
start
public void start()
throws javax.jms.JMSException
- Description copied from interface:
org.activemq.service.Service - Called to start the service
- Specified by:
startin interfaceorg.activemq.service.Service
stop
public void stop()
throws javax.jms.JMSException
- A hook to allow any embedded JMS Broker's to be closed down
- Specified by:
stopin interfaceorg.activemq.service.Service
getEmbeddedBroker
public org.activemq.broker.Broker getEmbeddedBroker() throws javax.jms.JMSException
registerBroker
public static void registerBroker(java.lang.String theURLString, org.activemq.broker.BrokerConnector brokerConnector)
unregisterBroker
public static void unregisterBroker(java.lang.String theURLString)
buildFromProperties
protected void buildFromProperties(java.util.Properties props)
- Set the properties that will represent the instance in JNDI
populateProperties
protected void populateProperties(java.util.Properties props)
- Initialize the instance from properties stored in JNDI
getBoolean
protected boolean getBoolean(java.util.Properties props, java.lang.String key)
- Helper method to return the property value as a boolean flag
getBoolean
protected boolean getBoolean(java.util.Properties props, java.lang.String key, boolean defaultValue)
- Helper method to return the property value as a boolean flag
createBrokerContainerFactory
protected org.activemq.broker.BrokerContainerFactory createBrokerContainerFactory() throws javax.jms.JMSException
createTransportChannel
protected org.activemq.transport.TransportChannel createTransportChannel(java.lang.String theURLString) throws javax.jms.JMSException
- Factory method to create a TransportChannel from a URL
getContainer
protected org.activemq.broker.BrokerContainer getContainer(java.lang.String url, java.lang.String name) throws javax.jms.JMSException
createBrokerConnector
protected org.activemq.broker.BrokerConnector createBrokerConnector(java.lang.String url) throws javax.jms.JMSException
ensureServerIsAvailable
protected org.activemq.transport.TransportChannel ensureServerIsAvailable(java.net.URI remoteLocation, org.activemq.transport.TransportChannel channel, org.activemq.broker.BrokerConnector brokerConnector, boolean created) throws javax.jms.JMSException
ensureVmServerIsAvailable
private void ensureVmServerIsAvailable(org.activemq.transport.TransportChannel channel, org.activemq.broker.BrokerConnector brokerConnector) throws javax.jms.JMSException
ensureMulticastChannelIsAvailable
protected org.activemq.transport.TransportChannel ensureMulticastChannelIsAvailable(java.net.URI remoteLocation, org.activemq.transport.TransportChannel channel, org.activemq.broker.BrokerConnector brokerConnector, boolean created) throws javax.jms.JMSException
createMulticastClientID
protected java.lang.String createMulticastClientID()
- Creates the clientID for the multicast client (used to dispatch local
messages over a multicast bus)
createURI
protected java.net.URI createURI(java.lang.String protocol, java.net.URI uri) throws javax.jms.JMSException
createURI
protected java.net.URI createURI(java.lang.String uri) throws javax.jms.JMSException
onConnectionClose
void onConnectionClose(ActiveMQConnection connection) throws javax.jms.JMSException
- Called when a connection is closed so that we can shut down any embedded brokers cleanly
onConnectionCreate
void onConnectionCreate(ActiveMQConnection connection)
|
|||||||||
| Home >> All >> org >> [ activemq overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC