Class JGroupsTransportManager


  • public class JGroupsTransportManager
    extends org.eclipse.persistence.sessions.coordination.broadcast.BroadcastTransportManager

    Purpose: Provide a transport implementation for the Remote Command Module (RCM) that publishes to a JGroup channel.

    JGroups is a library for distributed communications.

    If issues are encountered with the default setting try,
    -Djava.net.preferIPv4Stack=true

    Since:
    EclipseLink 2.6
    Author:
    James Sutherland
    • Field Summary

      • Fields inherited from class org.eclipse.persistence.sessions.coordination.broadcast.BroadcastTransportManager

        topicName
      • Fields 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

      Constructors 
      Constructor Description
      JGroupsTransportManager()
      PUBLIC: Creates a JGroupsTransportManager.
      JGroupsTransportManager​(org.eclipse.persistence.sessions.coordination.RemoteCommandManager rcm)
      PUBLIC: Creates a JGroupsTransportManager.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      protected org.eclipse.persistence.internal.sessions.coordination.broadcast.BroadcastRemoteConnection createConnection​(boolean isLocalConnectionBeingCreated)
      INTERNAL: This method creates JGroupsRemoteConnection to be used by this TransportManager.
      void createConnections()
      INTERNAL: JGroups does not require a DiscoveryManager, therefore this method is called during RCM initialization to create all the necessary connections.
      void createExternalConnection()
      INTERNAL: JGroups only has a single connection.
      void createLocalConnection()
      INTERNAL: JGroups only requires a single connection.
      String getConfigFile()
      PUBLIC: Return the JGroups config xml file name.
      Map<String,​org.eclipse.persistence.internal.sessions.coordination.RemoteConnection> getConnectionsToExternalServicesForCommandPropagation()
      INTERNAL: In case there's no external connection attempts to create one.
      void removeLocalConnection()
      INTERNAL: No-op, as the local connection does not need to be removed as JGroups manages registration.
      void setConfig​(String config)  
      void setConfigFile​(String configFile)
      Deprecated.
      • Methods inherited from class org.eclipse.persistence.sessions.coordination.broadcast.BroadcastTransportManager

        addConnectionToExternalService, connectBackToRemote, createConnection, createDiscoveryManager, getTopicName, setTopicName
      • Methods 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, initialize, newTransportManager, removeAllConnectionsToExternalServices, removeConnectionToExternalService, setEncryptedPassword, setEncryptionClassName, setInitialContextFactoryName, setLocalContextProperties, setNamingServiceType, setPassword, setRemoteCommandManager, setRemoteContextProperties, setShouldRemoveConnectionOnError, setUserName, shouldRemoveConnectionOnError
    • Constructor Detail

      • JGroupsTransportManager

        public JGroupsTransportManager()
        PUBLIC: Creates a JGroupsTransportManager.
      • JGroupsTransportManager

        public JGroupsTransportManager​(org.eclipse.persistence.sessions.coordination.RemoteCommandManager rcm)
        PUBLIC: Creates a JGroupsTransportManager.
    • Method Detail

      • createConnection

        protected org.eclipse.persistence.internal.sessions.coordination.broadcast.BroadcastRemoteConnection createConnection​(boolean isLocalConnectionBeingCreated)
                                                                                                                       throws org.eclipse.persistence.exceptions.RemoteCommandManagerException
        INTERNAL: This method creates JGroupsRemoteConnection to be used by this TransportManager. It uses a JGroups JChannel using the RCM channel name and specified (or defaulted) config file. Channel is set to not receive own messages.
        Throws:
        org.eclipse.persistence.exceptions.RemoteCommandManagerException
      • createConnections

        public void createConnections()
        INTERNAL: JGroups does not require a DiscoveryManager, therefore this method is called during RCM initialization to create all the necessary connections.
        Overrides:
        createConnections in class org.eclipse.persistence.sessions.coordination.broadcast.BroadcastTransportManager
      • createExternalConnection

        public void createExternalConnection()
        INTERNAL: JGroups only has a single connection. Verify there are no external connections, use the local connection as the external connection.
      • createLocalConnection

        public void createLocalConnection()
        INTERNAL: JGroups only requires a single connection. In case the local connection doesn't exist, this method creates it.
        Specified by:
        createLocalConnection in class org.eclipse.persistence.sessions.coordination.TransportManager
      • 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 external connections (only a single connection for JGroups).
        Overrides:
        getConnectionsToExternalServicesForCommandPropagation in class org.eclipse.persistence.sessions.coordination.TransportManager
      • removeLocalConnection

        public void removeLocalConnection()
        INTERNAL: No-op, as the local connection does not need to be removed as JGroups manages registration.
        Specified by:
        removeLocalConnection in class org.eclipse.persistence.sessions.coordination.TransportManager
      • getConfigFile

        public String getConfigFile()
        PUBLIC: Return the JGroups config xml file name.
      • setConfigFile

        @Deprecated
        public void setConfigFile​(String configFile)
        Deprecated.
        PUBLIC: Set the JGroups config xml file name.
      • setConfig

        public void setConfig​(String config)
        Overrides:
        setConfig in class org.eclipse.persistence.sessions.coordination.TransportManager