Class TransportManager

  • Direct Known Subclasses:
    BroadcastTransportManager, CORBATransportManager, RMITransportManager

    public abstract class TransportManager
    extends Object

    Purpose: Provide an abstract class that offers a common API to handling remote command connections.

    Description: This class manages the remote connections to other RCM service instances and posts the local connection to this service instance in a name service so that other RCM service instances can connect to it.

    Since:
    OracleAS TopLink 10g (9.0.4)
    Author:
    Steven Vo
    • Constructor Detail

      • TransportManager

        public TransportManager()
    • Method Detail

      • createConnection

        public abstract org.eclipse.persistence.internal.sessions.coordination.RemoteConnection createConnection​(ServiceId serviceId)
        INTERNAL: Return a remote connection to the specified service
      • createConnections

        public void createConnections()
        INTERNAL: Does nothing by default. In case TransportManager doesn't use DiscoveryManager (createDiscoveryManager method retuns null) this method called during RCM initialization to create all the necessary connections. TransportManager ancestors that override createDiscoveryManager method to return null must override this method, too.
      • connectBackToRemote

        public void connectBackToRemote​(org.eclipse.persistence.internal.sessions.coordination.RemoteConnection connection)
                                 throws Exception
        INTERNAL: This method is called by the remote command manager when this service should connect back ('handshake') to the service from which this remote connection came.
        Throws:
        Exception
      • getConnectionToLocalHost

        public org.eclipse.persistence.internal.sessions.coordination.RemoteConnection getConnectionToLocalHost()
        INTERNAL: Return a remote connection to this service
      • createLocalConnection

        public abstract void createLocalConnection()
        INTERNAL: Put the remote connection to local host in naming service and return the of the created remote connection
      • getNamingServiceType

        public int getNamingServiceType()
        PUBLIC: Return the type of naming service used to look up remote connections to other service instances.
        Returns:
        The type of naming service used.
      • setNamingServiceType

        public void setNamingServiceType​(int serviceType)
        ADVANCED: Set the type of naming service used to look up remote connections to other service instances. The service type must be one of JNDI_NAMING_SERVICE or REGISTRY_NAMING_SERVICE.
      • getUserName

        public String getUserName()
        PUBLIC: Return the user name used as the value to the SECURITY_PRINCIPAL key in the cached context properties.
      • setUserName

        public void setUserName​(String userName)
        ADVANCED: Set the user name used as the value to the SECURITY_PRINCIPAL key in the cached context properties.
      • getPassword

        public String getPassword()
        PUBLIC: Return the password used as the value to the SECURITY_CREDENTIALS key in the cached context properties.
      • getEncryptedPassword

        public String getEncryptedPassword()
        PUBLIC: Return the encrypted (assumed) password used as the value to the SECURITY_CREDENTIALS key in the cached context properties.
      • setPassword

        public void setPassword​(String password)
        ADVANCED: Set the password used as the value to the SECURITY_CREDENTIALS key in the cached context properties.
      • setEncryptedPassword

        public void setEncryptedPassword​(String encryptedPassword)
        ADVANCED: Set the encrypted password used as the value to the SECURITY_CREDENTIALS key in the cached context properties.
      • getInitialContextFactoryName

        public String getInitialContextFactoryName()
        PUBLIC: Return the context factory name used as the value to the INITIAL_CONTEXT_FACTORY key in the cached context properties.
      • setInitialContextFactoryName

        public void setInitialContextFactoryName​(String contextFactoryName)
        ADVANCED: Set the context factory name used as the value to the INITIAL_CONTEXT_FACTORY key in the cached context properties.
      • getContext

        public Context getContext​(Hashtable contextProperties)
        INTERNAL: Helper method to get a naming context.
      • getRemoteContextProperties

        public Hashtable getRemoteContextProperties()
        ADVANCED: Return the cached properties that will be used to create the initial context when doing remote JNDI lookups.
      • setRemoteContextProperties

        public void setRemoteContextProperties​(Hashtable properties)
        ADVANCED: Set the cached properties that will be used to create the initial context when doing remote JNDI lookups.
      • getLocalContextProperties

        public Hashtable getLocalContextProperties()
        ADVANCED: Return the properties that will be used to create the initial context for local JNDI access.
      • setLocalContextProperties

        public void setLocalContextProperties​(Hashtable properties)
        ADVANCED: Set the properties that will be used to create the initial context for local JNDI access.
      • setRemoteCommandManager

        public void setRemoteCommandManager​(RemoteCommandManager rcm)
        INTERNAL:
      • addConnectionToExternalService

        public void addConnectionToExternalService​(org.eclipse.persistence.internal.sessions.coordination.RemoteConnection connection)
        INTERNAL: Add a remote Connection to a remote service.
      • removeConnectionToExternalService

        public void removeConnectionToExternalService​(org.eclipse.persistence.internal.sessions.coordination.RemoteConnection connection)
        INTERNAL: Remove a remote connection from the list of connections to receive remote commands.
      • removeAllConnectionsToExternalServices

        public void removeAllConnectionsToExternalServices()
        INTERNAL: Remove all remote connections from the list.
      • getConnectionsToExternalServices

        public Map<String,​org.eclipse.persistence.internal.sessions.coordination.RemoteConnection> getConnectionsToExternalServices()
        INTERNAL:
      • getConnectionsToExternalServicesForCommandPropagation

        public Map<String,​org.eclipse.persistence.internal.sessions.coordination.RemoteConnection> getConnectionsToExternalServicesForCommandPropagation()
        INTERNAL: Returns clone of the original map.
      • setShouldRemoveConnectionOnError

        public void setShouldRemoveConnectionOnError​(boolean shouldRemoveConnectionOnError)
        PUBLIC: Set whether connections to remote services should be disconnected when an error occurs.
      • shouldRemoveConnectionOnError

        public boolean shouldRemoveConnectionOnError()
        PUBLIC: Return whether connections to remote services should be disconnected when an error occurs.
      • setEncryptionClassName

        public void setEncryptionClassName​(String encryptionClassName)
        INTERNAL SECURITY: Set encryption class that will be loaded by the SecurableObjectHolder
      • initialize

        public void initialize()
        INTERNAL: Initialize default properties.
      • getRemoteHostContext

        public Context getRemoteHostContext​(String remoteHostURL)
        INTERNAL: Return the context used for looking up in the JNDI space of the specified remote URL.
      • createDiscoveryManager

        public DiscoveryManager createDiscoveryManager()
        ADVANCED: Factory of new DiscoveryManager for different transports. The RemoteCommandManger uses this method to create its DicscoveryManager. Sub-class of TransportManager should return special discovery if required. The default is discovery type is DiscoveryManager; If this method returns null then during initialization RemoteCommandManager calls createConnections method.
      • discardConnections

        public void discardConnections()
        INTERNAL: Remove all remote connections for its list and the local connection from JNDI or JMS Subsriber
      • removeLocalConnection

        public abstract void removeLocalConnection()
        ADVANCED: Remove the local connection from remote accesses. The implementation should set remove the local connection from JNDI or JMS and set it to null. This method is invoked internally by TopLink when the RCM is shutdown and should not be invoked by user's application.
      • setConfig

        public void setConfig​(String config)
        Generic API to allow config to be set.