Package org.objectweb.joram.mom.dest.jms
Class JMSConnections
- java.lang.Object
-
- org.objectweb.joram.mom.dest.jms.JMSConnections
-
- All Implemented Interfaces:
JMSConnectionsMBean
public final class JMSConnections extends Object implements JMSConnectionsMBean
TheJMSConnectionsservice handles the list of known AMQP servers, in order to keep live connections with them.
-
-
Field Summary
Fields Modifier and Type Field Description private static booleanDEBUGprivate static Loggerlogger(package private) static StringSAVE_FILE_NAMEprivate Map<String,JMSModule>serversstatic booleanTRANSIENT_CONFIGURATIONstatic StringTRANSIENT_CONFIGURATION_PROPERTY
-
Constructor Summary
Constructors Constructor Description JMSConnections()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddServer(String name, String cnxFactoryName)Adds a JMS server and starts a live connection with it, accessible using the connection factory retrieved on the JNDI server.voidaddServer(String name, String cnxFactoryName, String jndiFactoryClass, String jndiUrl)Adds a JMS server and starts a live connection with it, accessible using the connection factory retrieved on the JNDI server.voidaddServer(String name, String cnxFactoryName, String jndiFactoryClass, String jndiUrl, String user, String password)Adds a JMS server and starts a live connection with it, accessible using the connection factory retrieved on the JNDI server.voidaddServer(String name, String cnxFactoryName, String jndiFactoryClass, String jndiUrl, String user, String password, String clientID)Adds a JMS server and starts a live connection with it, accessible using the connection factory retrieved on the JNDI server.voiddeleteServer(String name)Removes the live connection to the specified AMQP server.List<JMSModule>getConnections()Gets the list of currently opened connections.String[]getServerNames()Gets the list of known servers.(package private) booleanreadSavedConf()Reads the configuration for JMS bridge connections from persistence.(package private) voidsaveConf()Saves the configuration for JMS bridge connections to persistence.voidstop()
-
-
-
Field Detail
-
logger
private static final Logger logger
-
DEBUG
private static final boolean DEBUG
-
SAVE_FILE_NAME
static final String SAVE_FILE_NAME
- See Also:
- Constant Field Values
-
TRANSIENT_CONFIGURATION_PROPERTY
public static final String TRANSIENT_CONFIGURATION_PROPERTY
- See Also:
- Constant Field Values
-
TRANSIENT_CONFIGURATION
public static final boolean TRANSIENT_CONFIGURATION
-
-
Method Detail
-
readSavedConf
boolean readSavedConf()
Reads the configuration for JMS bridge connections from persistence.- Returns:
- true if the configuration is read, false otherwise.
-
saveConf
void saveConf()
Saves the configuration for JMS bridge connections to persistence.
-
addServer
public void addServer(String name, String cnxFactoryName)
Adds a JMS server and starts a live connection with it, accessible using the connection factory retrieved on the JNDI server. A server is uniquely identified by the name of the connection factory. Adding an existing server won't do anything.- Specified by:
addServerin interfaceJMSConnectionsMBean- Parameters:
name- the name identifying the servercnxFactoryName- the name identifying the connection factory on the JNDI server
-
addServer
public void addServer(String name, String cnxFactoryName, String jndiFactoryClass, String jndiUrl)
Adds a JMS server and starts a live connection with it, accessible using the connection factory retrieved on the JNDI server. A server is uniquely identified by the name of the connection factory. Adding an existing server won't do anything.- Specified by:
addServerin interfaceJMSConnectionsMBean- Parameters:
name- the name identifying the servercnxFactoryName- the name identifying the connection factory on the JNDI serverjndiFactoryClass- the JNDI connection factory class namejndiUrl- the JNDI URL
-
addServer
public void addServer(String name, String cnxFactoryName, String jndiFactoryClass, String jndiUrl, String user, String password)
Adds a JMS server and starts a live connection with it, accessible using the connection factory retrieved on the JNDI server. A server is uniquely identified by the name of the connection factory. Adding an existing server won't do anything.- Specified by:
addServerin interfaceJMSConnectionsMBean- Parameters:
name- the name identifying the servercnxFactoryName- the name identifying the connection factory on the JNDI serverjndiFactoryClass- the JNDI connection factory class namejndiUrl- the JNDI URLuser- user namepassword- user password
-
addServer
public void addServer(String name, String cnxFactoryName, String jndiFactoryClass, String jndiUrl, String user, String password, String clientID)
Adds a JMS server and starts a live connection with it, accessible using the connection factory retrieved on the JNDI server. A server is uniquely identified by the name of the connection factory. Adding an existing server won't do anything.- Specified by:
addServerin interfaceJMSConnectionsMBean- Parameters:
name- the name identifying the servercnxFactoryName- the name identifying the connection factory on the JNDI serverjndiFactoryClass- the JNDI connection factory class namejndiUrl- the JNDI URLuser- user namepassword- user passwordclientID- the client identifier for this connection
-
deleteServer
public void deleteServer(String name)
Removes the live connection to the specified AMQP server.- Specified by:
deleteServerin interfaceJMSConnectionsMBean- Parameters:
name- the name identifying the server
-
getServerNames
public String[] getServerNames()
Gets the list of known servers.- Specified by:
getServerNamesin interfaceJMSConnectionsMBean
-
getConnections
public List<JMSModule> getConnections()
Gets the list of currently opened connections.- Returns:
- the list of usable connections.
-
stop
public void stop()
-
-