|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.activemq.jndi.JNDIBaseStorable
org.activemq.ActiveMQConnectionFactory
public class ActiveMQConnectionFactory
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.
ConnectionFactory
Field Summary | |
---|---|
protected BrokerContainer |
brokerContainer
|
protected String |
brokerName
|
protected String |
brokerURL
|
protected boolean |
cachingEnabled
|
protected String |
clientID
|
protected boolean |
copyMessageOnSend
|
protected boolean |
disableTimeStampsByDefault
|
protected boolean |
doMessageCompression
|
protected boolean |
doMessageFragmentation
|
protected boolean |
internalConnection
|
protected boolean |
J2EEcompliant
|
protected int |
messageCompressionLevel
|
protected int |
messageCompressionLimit
|
protected int |
messageCompressionStrategy
|
protected int |
messageFragmentationLimit
|
protected boolean |
optimizedMessageDispatch
|
protected String |
password
|
protected boolean |
prepareMessageBodyOnSend
|
protected boolean |
quickClose
|
protected boolean |
useAsyncSend
Should we use an async send for persistent non transacted messages ? |
protected String |
userName
|
Constructor Summary | |
---|---|
ActiveMQConnectionFactory()
Default Constructor for ActiveMQConnectionFactory |
|
ActiveMQConnectionFactory(BrokerContainer container)
Constructs a ConnectionFactory with an already configured and started BrokerContainer
ready for use in embedded mode. |
|
ActiveMQConnectionFactory(BrokerContainer container,
String brokerURL)
Constructs a ConnectionFactory with an already configured and started BrokerContainer
ready for use in embedded mode and the brokerURL connection. |
|
ActiveMQConnectionFactory(String brokerURL)
|
|
ActiveMQConnectionFactory(String userName,
String password,
String brokerURL)
|
Method Summary | |
---|---|
protected void |
buildFromProperties(Properties props)
Set the properties that will represent the instance in JNDI |
protected BrokerConnector |
createBrokerConnector(String url)
|
protected BrokerContainerFactory |
createBrokerContainerFactory()
|
Connection |
createConnection()
Create a JMS Connection |
Connection |
createConnection(String userName,
String password)
|
protected String |
createMulticastClientID()
Creates the clientID for the multicast client (used to dispatch local messages over a multicast bus) |
QueueConnection |
createQueueConnection()
Create a JMS QueueConnection |
QueueConnection |
createQueueConnection(String userName,
String password)
|
TopicConnection |
createTopicConnection()
Create a JMS TopicConnection |
TopicConnection |
createTopicConnection(String userName,
String password)
|
protected TransportChannel |
createTransportChannel(String theURLString)
Factory method to create a TransportChannel from a URL |
protected URI |
createURI(String uri)
|
protected URI |
createURI(String protocol,
URI uri)
|
protected TransportChannel |
ensureMulticastChannelIsAvailable(URI remoteLocation,
TransportChannel channel,
BrokerConnector brokerConnector,
boolean created)
|
protected TransportChannel |
ensureServerIsAvailable(URI remoteLocation,
TransportChannel channel,
BrokerConnector brokerConnector,
boolean created)
|
protected boolean |
getBoolean(Properties props,
String key)
Helper method to return the property value as a boolean flag |
protected boolean |
getBoolean(Properties props,
String key,
boolean defaultValue)
Helper method to return the property value as a boolean flag |
BrokerContainer |
getBrokerContainer()
|
BrokerContainerFactory |
getBrokerContainerFactory()
|
BrokerContext |
getBrokerContext()
Returns the context used to store broker containers and connectors which defaults to using the singleton |
String |
getBrokerName()
The name of the broker to use if creating an embedded broker |
String |
getBrokerName(String url)
The name of the broker to use if creating an embedded broker |
String |
getBrokerURL()
|
String |
getBrokerXmlConfig()
|
String |
getClientID()
|
protected BrokerContainer |
getContainer(String url,
String name)
|
Broker |
getEmbeddedBroker()
|
JMSStatsImpl |
getFactoryStats()
|
int |
getMessageCompressionLimit()
|
int |
getMessageCompressionStrategy()
|
int |
getMessageFragmentationLimit()
|
String |
getPassword()
|
ActiveMQPrefetchPolicy |
getPrefetchPolicy()
Allows the prefetch policy to be configured |
StatsImpl |
getStats()
|
String |
getUserName()
|
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 |
protected void |
populateProperties(Properties props)
Initialize the instance from properties stored in JNDI |
static void |
registerBroker(String theURLString,
BrokerConnector brokerConnector)
|
void |
setBrokerContainerFactory(BrokerContainerFactory brokerContainerFactory)
|
void |
setBrokerContext(BrokerContext brokerContext)
|
void |
setBrokerName(String brokerName)
|
void |
setBrokerURL(String brokerURL)
|
void |
setBrokerXmlConfig(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(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(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(String userName)
|
void |
setWireFormat(String format)
set the WireFormat by name - e.g. |
void |
setWireFormat(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(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 |
---|
protected BrokerContainer brokerContainer
protected String userName
protected String password
protected String brokerURL
protected String clientID
protected String brokerName
protected boolean useAsyncSend
protected boolean disableTimeStampsByDefault
protected boolean J2EEcompliant
protected boolean doMessageCompression
protected int messageCompressionLimit
protected int messageCompressionLevel
protected int messageCompressionStrategy
protected boolean doMessageFragmentation
protected int messageFragmentationLimit
protected boolean cachingEnabled
protected boolean prepareMessageBodyOnSend
protected boolean quickClose
protected boolean internalConnection
protected boolean optimizedMessageDispatch
protected boolean copyMessageOnSend
Constructor Detail |
---|
public ActiveMQConnectionFactory()
public ActiveMQConnectionFactory(String brokerURL)
public ActiveMQConnectionFactory(String userName, String password, String brokerURL)
public ActiveMQConnectionFactory(BrokerContainer container)
ConnectionFactory
with an already configured and started BrokerContainer
ready for use in embedded mode.
container
- public ActiveMQConnectionFactory(BrokerContainer container, String brokerURL)
ConnectionFactory
with an already configured and started BrokerContainer
ready for use in embedded mode and the brokerURL connection.
container
- Method Detail |
---|
public StatsImpl getStats()
getStats
in interface StatsCapable
public JMSStatsImpl getFactoryStats()
public String getBrokerURL()
public void setBrokerURL(String brokerURL)
brokerURL
- The brokerURL to set.public String getClientID()
public void setClientID(String clientID)
clientID
- The clientID to set.public String getPassword()
public void setPassword(String password)
password
- The password to set.public String getUserName()
public void setUserName(String userName)
userName
- The userName to set.public boolean isUseEmbeddedBroker()
public void setUseEmbeddedBroker(boolean useEmbeddedBroker)
useEmbeddedBroker
- public String getBrokerName()
public String getBrokerName(String url)
public void setBrokerName(String brokerName)
public boolean isUseAsyncSend()
public void setUseAsyncSend(boolean useAsyncSend)
useAsyncSend
- The useAsyncSend to set.public WireFormat getWireFormat()
public ActiveMQPrefetchPolicy getPrefetchPolicy()
public void setPrefetchPolicy(ActiveMQPrefetchPolicy prefetchPolicy)
prefetchPolicy
- public void setTurboBoost(boolean value)
Enables asynchronous sending of messages and disables timestamps by default
value
- - the flag to setpublic boolean isTurboBoost()
public boolean isOptimizedMessageDispatch()
public void setOptimizedMessageDispatch(boolean optimizedMessageDispatch)
optimizedMessageDispatch
- The optimizedMessageDispatch to set.public boolean isDisableTimeStampsByDefault()
public void setDisableTimeStampsByDefault(boolean disableTimeStampsByDefault)
disableTimeStampsByDefault
- The disableTimeStampsByDefault to set.public boolean isJ2EEcompliant()
public void setJ2EEcompliant(boolean ecompliant)
ecompliant
- The j2EEcompliant to set.public boolean isInternalConnection()
public void setInternalConnection(boolean internalConnection)
internalConnection
- The internalConnection to set.public boolean isQuickClose()
public void setQuickClose(boolean quickClose)
quickClose
- The quickClose to set.public boolean isDoMessageCompression()
public void setDoMessageCompression(boolean doMessageCompression)
doMessageCompression
- The doMessageCompression to set.public boolean isDoMessageFragmentation()
public void setDoMessageFragmentation(boolean doMessageFragmentation)
doMessageFragmentation
- The doMessageFragmentation to set.public int getMessageCompressionLimit()
public void setMessageCompressionLimit(int messageCompressionLimit)
messageCompressionLimit
- The messageCompressionLimit to set.public int getMessageCompressionStrategy()
public void setMessageCompressionStrategy(int messageCompressionStrategy)
messageCompressionStrategy
- The messageCompressionStrategy to set.public int getMessageFragmentationLimit()
public void setMessageFragmentationLimit(int messageFragmentationLimit)
messageFragmentationLimit
- The messageFragmentationLimit to set.public boolean isCachingEnabled()
public void setCachingEnabled(boolean cachingEnabled)
cachingEnabled
- The cachingEnabled to set.public boolean isPrepareMessageBodyOnSend()
public void setPrepareMessageBodyOnSend(boolean prePrepareMessageOnSend)
prePrepareMessageOnSend
- The prePrepareMessageOnSend to set.public boolean isCopyMessageOnSend()
public void setCopyMessageOnSend(boolean copyMessageOnSend)
copyMessageOnSend
- The copyMessageOnSend to set.public void setWireFormat(WireFormat wireFormat)
wireFormat
- public void setWireFormat(String format) throws JMSException
format
-
JMSException
public String getBrokerXmlConfig()
public BrokerContainer getBrokerContainer()
public void setBrokerXmlConfig(String brokerXmlConfig)
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.setUseEmbeddedBroker(boolean)
public BrokerContainerFactory getBrokerContainerFactory() throws JMSException
JMSException
public void setBrokerContainerFactory(BrokerContainerFactory brokerContainerFactory)
public BrokerContext getBrokerContext()
public void setBrokerContext(BrokerContext brokerContext)
public Connection createConnection() throws JMSException
createConnection
in interface ConnectionFactory
JMSException
- if an error occurs creating the Connectionpublic Connection createConnection(String userName, String password) throws JMSException
createConnection
in interface ConnectionFactory
userName
- password
-
JMSException
- if an error occurs creating the Connectionpublic QueueConnection createQueueConnection() throws JMSException
createQueueConnection
in interface QueueConnectionFactory
JMSException
- if an error occurs creating the Connectionpublic QueueConnection createQueueConnection(String userName, String password) throws JMSException
createQueueConnection
in interface QueueConnectionFactory
userName
- password
-
JMSException
- if an error occurs creating the Connectionpublic TopicConnection createTopicConnection() throws JMSException
createTopicConnection
in interface TopicConnectionFactory
JMSException
- if an error occurs creating the Connectionpublic TopicConnection createTopicConnection(String userName, String password) throws JMSException
createTopicConnection
in interface TopicConnectionFactory
userName
- password
-
JMSException
- if an error occurs creating the Connectionpublic void start() throws JMSException
Service
start
in interface Service
JMSException
public void stop() throws JMSException
stop
in interface Service
JMSException
public Broker getEmbeddedBroker() throws JMSException
JMSException
public static void registerBroker(String theURLString, BrokerConnector brokerConnector)
public static void unregisterBroker(String theURLString)
protected void buildFromProperties(Properties props)
buildFromProperties
in class JNDIBaseStorable
props
- protected void populateProperties(Properties props)
populateProperties
in class JNDIBaseStorable
props
- protected boolean getBoolean(Properties props, String key)
props
- key
-
protected boolean getBoolean(Properties props, String key, boolean defaultValue)
props
- key
- defaultValue
-
protected BrokerContainerFactory createBrokerContainerFactory() throws JMSException
JMSException
protected TransportChannel createTransportChannel(String theURLString) throws JMSException
theURLString
-
JMSException
protected BrokerContainer getContainer(String url, String name) throws JMSException
JMSException
protected BrokerConnector createBrokerConnector(String url) throws JMSException
JMSException
protected TransportChannel ensureServerIsAvailable(URI remoteLocation, TransportChannel channel, BrokerConnector brokerConnector, boolean created) throws JMSException
JMSException
protected TransportChannel ensureMulticastChannelIsAvailable(URI remoteLocation, TransportChannel channel, BrokerConnector brokerConnector, boolean created) throws JMSException
JMSException
protected String createMulticastClientID()
protected URI createURI(String protocol, URI uri) throws JMSException
JMSException
protected URI createURI(String uri) throws JMSException
JMSException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |