Class JMSPublishingTransportManager
java.lang.Object
org.eclipse.persistence.sessions.coordination.TransportManager
org.eclipse.persistence.sessions.coordination.broadcast.BroadcastTransportManager
org.eclipse.persistence.sessions.coordination.jms.JMSPublishingTransportManager
- Direct Known Subclasses:
JMSTopicTransportManager
Purpose: Provide a transport implementation for the Remote Command Module (RCM) that publishes to a JMS topic.
Description: This class manages two connections: an external connection for publishing to JMS, and a local connection which can be used to process JMS messages received from an application JMS listener.
- Author:
- Chris Delahunt
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringstatic final Stringstatic final Stringprotected booleanFields inherited from class org.eclipse.persistence.sessions.coordination.broadcast.BroadcastTransportManager
topicNameFields inherited from class org.eclipse.persistence.sessions.coordination.TransportManager
connectionsToExternalServices, DEFAULT_CONTEXT_FACTORY, DEFAULT_DEDICATED_CONNECTION_KEY, DEFAULT_DEDICATED_CONNECTION_VALUE, DEFAULT_IIOP_URL_PORT, DEFAULT_IIOP_URL_PROTOCOL, DEFAULT_NAMING_SERVICE, DEFAULT_REMOVE_CONNECTION_ON_ERROR_MODE, DEFAULT_URL_PORT, DEFAULT_URL_PROTOCOL, DEFAULT_USER_NAME, JNDI_NAMING_SERVICE, localConnection, localContextProperties, namingServiceType, rcm, REGISTRY_NAMING_SERVICE, remoteContextProperties, securableObjectHolder, shouldRemoveConnectionOnError -
Constructor Summary
ConstructorsConstructorDescriptionPUBLIC: Creates a JMSPublishingOnlyTopicTransportManager -
Method Summary
Modifier and TypeMethodDescriptionprotected org.eclipse.persistence.internal.sessions.coordination.jms.JMSTopicRemoteConnectioncreateConnection(boolean isLocalConnectionBeingCreated) INTERNAL: This method creates JMSTopicRemoteConnection to be used by this TransportManager.voidINTERNAL: JMSTopicTransportManager doesn't use DiscoveryManager, therefore this method is called during RCM initialization to create all the necessary connections.voidINTERNAL: JMSPublishingTransportManager has maximum one external connection.voidINTERNAL: JMSPublishingTransportManager has only two connections: one local and one external.INTERNAL: In case there's no external connection attempts to create one.booleanPUBLIC: flag used to toggle between j2EE/JMS spec compliant behavior and legacy behavior.protected jakarta.jms.TopicINTERNAL:protected jakarta.jms.TopicConnectionFactorygetTopicConnectionFactory(Context remoteHostContext) INTERNAL:PUBLIC: Return the JMS Topic Connection Factory Name for the JMS Topic connections.PUBLIC: Return the URL of the machine on the network that hosts the JMS Topic.voidINTERNAL: Initialize default properties.voidINTERNAL: No-op, as the local connection does not need to be removed from JMSPublishingTransportManager.voidsetNamingServiceType(int serviceType) ADVANCED: This function is not supported for naming service other than JNDI or TransportManager.JNDI_NAMING_SERVICE.voidsetShouldReuseJMSTopicPublisher(boolean reuseJMSTopicPublisher) PUBLIC: flag used to toggle between j2EE/JMS spec compliant behavior and legacy behavior.voidsetTopicConnectionFactoryName(String newTopicConnectionFactoryName) PUBLIC: Configure the JMS Topic Connection Factory Name for the JMS Topic connections.voidsetTopicHostUrl(String jmsHostUrl) PUBLIC: Configure the URL of the machine on the network that hosts the JMS Topic.Methods inherited from class org.eclipse.persistence.sessions.coordination.broadcast.BroadcastTransportManager
addConnectionToExternalService, connectBackToRemote, createConnection, createDiscoveryManager, getTopicName, setTopicNameMethods inherited from class org.eclipse.persistence.sessions.coordination.TransportManager
decrypt, discardConnections, encrypt, getConnectionsToExternalServices, getConnectionToLocalHost, getContext, getEncryptedPassword, getInitialContextFactoryName, getLocalContextProperties, getNamingServiceType, getPassword, getRemoteCommandManager, getRemoteContextProperties, getRemoteHostContext, getUserName, hasPassword, newSunCORBATransportManager, removeAllConnectionsToExternalServices, removeConnectionToExternalService, setConfig, setEncryptedPassword, setEncryptionClassName, setInitialContextFactoryName, setLocalContextProperties, setPassword, setRemoteCommandManager, setRemoteContextProperties, setShouldRemoveConnectionOnError, setUserName, shouldRemoveConnectionOnError
-
Field Details
-
connectionFactoryName
-
reuseJMSTopicPublisher
protected boolean reuseJMSTopicPublisher -
DEFAULT_TOPIC
- See Also:
-
DEFAULT_CONNECTION_FACTORY
- See Also:
-
-
Constructor Details
-
JMSPublishingTransportManager
PUBLIC: Creates a JMSPublishingOnlyTopicTransportManager
-
-
Method Details
-
createConnection
protected org.eclipse.persistence.internal.sessions.coordination.jms.JMSTopicRemoteConnection createConnection(boolean isLocalConnectionBeingCreated) throws RemoteCommandManagerException INTERNAL: This method creates JMSTopicRemoteConnection to be used by this TransportManager. Don't confuse this method with no-op createConnection(ServiceId serviceId).- Throws:
RemoteCommandManagerException
-
createConnections
public void createConnections()INTERNAL: JMSTopicTransportManager doesn't use DiscoveryManager, therefore this method is called during RCM initialization to create all the necessary connections.- Overrides:
createConnectionsin classBroadcastTransportManager
-
createExternalConnection
public void createExternalConnection()INTERNAL: JMSPublishingTransportManager has maximum one external connection. Verify there are no external connections, create a new external connection, add it to external connections' map. -
createLocalConnection
public void createLocalConnection()INTERNAL: JMSPublishingTransportManager has only two connections: one local and one external. In case the local connection doesn't exist, this method creates it and holds it to be used when processing incoming JMS messages. The stored local connection on JMSPublishingTransportManager does not connect to topicConnection, and instead must be used from an MDB when a message is received- Specified by:
createLocalConnectionin classTransportManager
-
getConnectionsToExternalServicesForCommandPropagation
public Map<String,org.eclipse.persistence.internal.sessions.coordination.RemoteConnection> getConnectionsToExternalServicesForCommandPropagation()INTERNAL: In case there's no external connection attempts to create one. Returns clone of the original map.- Overrides:
getConnectionsToExternalServicesForCommandPropagationin classTransportManager
-
getReuseJMSTopicPublisher
public boolean getReuseJMSTopicPublisher()PUBLIC: flag used to toggle between j2EE/JMS spec compliant behavior and legacy behavior. Default value false causes external JMSTopicRemoteConnection to cache the TopicConnectionFactory and obtain TopicConnections, TopicSession and TopicPublishers every time executeCommand is called, and then closing them immediately. This is JMS and J2EE compliant, as the TopicConnection is never reused in different threads. True causes TopicConnection, TopicSession and TopicPublisher to be cached within the JMSTopicRemoteConnection and used for every executeCommand call. These objects can potentially used concurrently, which the JMS spec does not force providers to support. -
getTopic
INTERNAL: -
getTopicConnectionFactory
INTERNAL: -
getTopicConnectionFactoryName
PUBLIC: Return the JMS Topic Connection Factory Name for the JMS Topic connections. -
getTopicHostUrl
PUBLIC: Return the URL of the machine on the network that hosts the JMS Topic. This is a required property and must be configured. -
initialize
public void initialize()INTERNAL: Initialize default properties.- Overrides:
initializein classTransportManager
-
removeLocalConnection
public void removeLocalConnection()INTERNAL: No-op, as the local connection does not need to be removed from JMSPublishingTransportManager. An application must close the connection directly if it is using the local connection as a listener.- Specified by:
removeLocalConnectionin classTransportManager
-
setNamingServiceType
public void setNamingServiceType(int serviceType) ADVANCED: This function is not supported for naming service other than JNDI or TransportManager.JNDI_NAMING_SERVICE.- Overrides:
setNamingServiceTypein classTransportManager
-
setShouldReuseJMSTopicPublisher
public void setShouldReuseJMSTopicPublisher(boolean reuseJMSTopicPublisher) PUBLIC: flag used to toggle between j2EE/JMS spec compliant behavior and legacy behavior. Default value false causes external JMSTopicRemoteConnection to cache the TopicConnectionFactory and obtain TopicConnections, TopicSession and TopicPublishers every time executeCommand is called, and then closing them immediately. This is JMS and J2EE compliant, as the TopicConnection is never reused in different threads. True causes TopicConnection, TopicSession and TopicPublisher to be cached within the JMSTopicRemoteConnection and used for every executeCommand call. These objects can potentially used concurrently, which the JMS spec does not force providers to support.- Parameters:
reuseJMSTopicPublisher-
-
setTopicConnectionFactoryName
PUBLIC: Configure the JMS Topic Connection Factory Name for the JMS Topic connections. -
setTopicHostUrl
PUBLIC: Configure the URL of the machine on the network that hosts the JMS Topic. This is a required property and must be configured.
-