|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.activemq.jndi.JNDIBaseStorable
org.codehaus.activemq.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 java.lang.String |
brokerURL
|
protected java.lang.String |
clientID
|
protected static BrokerContainer |
container
|
protected java.lang.String |
password
|
protected java.lang.String |
userName
|
Constructor Summary | |
ActiveMQConnectionFactory()
Default Constructor for ActiveMQConnectionFactory |
|
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 BrokerConnector |
createBrokerConnector(java.lang.String url)
|
Connection |
createConnection()
Create a JMS Connection |
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) |
QueueConnection |
createQueueConnection()
Create a JMS QueueConnection |
QueueConnection |
createQueueConnection(java.lang.String userName,
java.lang.String password)
|
TopicConnection |
createTopicConnection()
Create a JMS TopicConnection |
TopicConnection |
createTopicConnection(java.lang.String userName,
java.lang.String password)
|
protected 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 TransportChannel |
ensureMulticastChannelIsAvailable(java.net.URI remoteLocation,
TransportChannel channel,
BrokerConnector brokerConnector,
boolean created)
|
protected TransportChannel |
ensureServerIsAvailable(java.net.URI remoteLocation,
TransportChannel channel,
BrokerConnector brokerConnector,
boolean created)
|
protected boolean |
getBoolean(java.util.Properties props,
java.lang.String key)
Helper method to return the property value as a boolean flag |
BrokerContainerFactory |
getBrokerContainerFactory()
|
java.lang.String |
getBrokerURL()
|
java.lang.String |
getClientID()
|
protected BrokerContainer |
getContainer(java.lang.String brokerName)
|
JMSStatsImpl |
getFactoryStats()
|
java.lang.String |
getPassword()
|
Stats |
getStats()
|
java.lang.String |
getUserName()
|
WireFormat |
getWireFormat()
|
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,
BrokerConnector brokerConnector)
|
void |
setBrokerContainerFactory(BrokerContainerFactory brokerContainerFactory)
|
void |
setBrokerURL(java.lang.String brokerURL)
|
void |
setClientID(java.lang.String clientID)
|
void |
setPassword(java.lang.String password)
|
void |
setUseEmbeddedBroker(boolean useEmbeddedBroker)
Allows embedded brokers to be associated with a connection factory |
void |
setUserName(java.lang.String userName)
|
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(java.lang.String theURLString)
|
Methods inherited from class org.codehaus.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 static BrokerContainer container
protected java.lang.String userName
protected java.lang.String password
protected java.lang.String brokerURL
protected java.lang.String clientID
Constructor Detail |
public ActiveMQConnectionFactory()
public ActiveMQConnectionFactory(java.lang.String brokerURL)
public ActiveMQConnectionFactory(java.lang.String userName, java.lang.String password, java.lang.String brokerURL)
Method Detail |
public Stats getStats()
getStats
in interface StatsCapable
public JMSStatsImpl getFactoryStats()
public java.lang.String getBrokerURL()
public void setBrokerURL(java.lang.String brokerURL)
brokerURL
- The brokerURL to set.public java.lang.String getClientID()
public void setClientID(java.lang.String clientID)
clientID
- The clientID to set.public java.lang.String getPassword()
public void setPassword(java.lang.String password)
password
- The password to set.public java.lang.String getUserName()
public void setUserName(java.lang.String userName)
userName
- The userName to set.public boolean isUseEmbeddedBroker()
public void setUseEmbeddedBroker(boolean useEmbeddedBroker)
useEmbeddedBroker
- public WireFormat getWireFormat()
public void setWireFormat(WireFormat wireFormat)
wireFormat
- public BrokerContainerFactory getBrokerContainerFactory()
public void setBrokerContainerFactory(BrokerContainerFactory brokerContainerFactory)
protected void buildFromProperties(java.util.Properties props)
buildFromProperties
in class JNDIBaseStorable
props
- protected void populateProperties(java.util.Properties props)
populateProperties
in class JNDIBaseStorable
props
- protected boolean getBoolean(java.util.Properties props, java.lang.String key)
public Connection createConnection() throws JMSException
createConnection
in interface ConnectionFactory
JMSException
- if an error occurs creating the Connectionpublic Connection createConnection(java.lang.String userName, java.lang.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(java.lang.String userName, java.lang.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(java.lang.String userName, java.lang.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
protected TransportChannel createTransportChannel(java.lang.String theURLString) throws JMSException
JMSException
public static void registerBroker(java.lang.String theURLString, BrokerConnector brokerConnector)
public static void unregisterBroker(java.lang.String theURLString)
protected BrokerContainer getContainer(java.lang.String brokerName) throws JMSException
JMSException
protected BrokerConnector createBrokerConnector(java.lang.String url) throws JMSException
JMSException
protected TransportChannel ensureServerIsAvailable(java.net.URI remoteLocation, TransportChannel channel, BrokerConnector brokerConnector, boolean created) throws JMSException
JMSException
protected TransportChannel ensureMulticastChannelIsAvailable(java.net.URI remoteLocation, TransportChannel channel, BrokerConnector brokerConnector, boolean created) throws JMSException
JMSException
protected java.lang.String createMulticastClientID()
protected java.net.URI createURI(java.lang.String protocol, java.net.URI uri) throws JMSException
JMSException
protected java.net.URI createURI(java.lang.String uri) throws JMSException
JMSException
void onConnectionClose(ActiveMQConnection connection) throws JMSException
connection
-
JMSException
void onConnectionCreate(ActiveMQConnection connection)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |