public abstract class TransportManager
extends java.lang.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.
Modifier and Type | Field and Description |
---|---|
protected java.util.Hashtable |
connectionsToExternalServices
Connections to other services
|
static java.lang.String |
DEFAULT_CONTEXT_FACTORY
Default JNDI properties for remote access
|
static java.lang.String |
DEFAULT_DEDICATED_CONNECTION_KEY |
static java.lang.String |
DEFAULT_DEDICATED_CONNECTION_VALUE |
static java.lang.String |
DEFAULT_IIOP_URL_PORT |
static java.lang.String |
DEFAULT_IIOP_URL_PROTOCOL |
static int |
DEFAULT_NAMING_SERVICE |
static boolean |
DEFAULT_REMOVE_CONNECTION_ON_ERROR_MODE |
static java.lang.String |
DEFAULT_URL_PORT |
static java.lang.String |
DEFAULT_URL_PROTOCOL
Defaults for RMI applications
|
static java.lang.String |
DEFAULT_USER_NAME |
static int |
JNDI_NAMING_SERVICE
Valid values for naming service type
|
protected org.eclipse.persistence.internal.sessions.coordination.RemoteConnection |
localConnection
The remote command connection to this transport
|
protected java.util.Hashtable |
localContextProperties
Properties to obtain the context used for local JNDI access
|
protected int |
namingServiceType
The type of naming service used to look up other connections
|
protected RemoteCommandManager |
rcm
The RCM that manages this transport
|
static int |
REGISTRY_NAMING_SERVICE |
protected java.util.Hashtable |
remoteContextProperties
Properties to obtain the context used for remote JNDI access
|
protected org.eclipse.persistence.internal.security.SecurableObjectHolder |
securableObjectHolder
Security util that is used to decrypt and encrypt password
|
protected boolean |
shouldRemoveConnectionOnError
Determines whether a connection should be discarded if an error occurs on it
|
Constructor and Description |
---|
TransportManager() |
Modifier and Type | Method and Description |
---|---|
void |
addConnectionToExternalService(org.eclipse.persistence.internal.sessions.coordination.RemoteConnection connection)
INTERNAL:
Add a remote Connection to a remote service.
|
void |
connectBackToRemote(org.eclipse.persistence.internal.sessions.coordination.RemoteConnection connection)
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.
|
abstract org.eclipse.persistence.internal.sessions.coordination.RemoteConnection |
createConnection(ServiceId serviceId)
INTERNAL:
Return a remote connection to the specified service
|
void |
createConnections()
INTERNAL:
Does nothing by default.
|
DiscoveryManager |
createDiscoveryManager()
ADVANCED:
Factory of new DiscoveryManager for different transports.
|
abstract void |
createLocalConnection()
INTERNAL:
Put the remote connection to local host in naming service and return the of the created remote connection
|
protected java.lang.String |
decrypt(java.lang.String encryptedPwd)
INTERNAL:
Security method called by the children classes
|
void |
discardConnections()
INTERNAL:
Remove all remote connections for its list and the local connection from JNDI or JMS Subsriber
|
protected java.lang.String |
encrypt(java.lang.String pwd)
INTERNAL:
Security method.
|
java.util.Map<java.lang.String,org.eclipse.persistence.internal.sessions.coordination.RemoteConnection> |
getConnectionsToExternalServices()
INTERNAL:
|
java.util.Map<java.lang.String,org.eclipse.persistence.internal.sessions.coordination.RemoteConnection> |
getConnectionsToExternalServicesForCommandPropagation()
INTERNAL:
Returns clone of the original map.
|
org.eclipse.persistence.internal.sessions.coordination.RemoteConnection |
getConnectionToLocalHost()
INTERNAL:
Return a remote connection to this service
|
javax.naming.Context |
getContext(java.util.Hashtable contextProperties)
INTERNAL:
Helper method to get a naming context.
|
java.lang.String |
getEncryptedPassword()
PUBLIC:
Return the encrypted (assumed) password used as the value to the
SECURITY_CREDENTIALS key in the cached context properties.
|
java.lang.String |
getInitialContextFactoryName()
PUBLIC:
Return the context factory name used as the value to the INITIAL_CONTEXT_FACTORY
key in the cached context properties.
|
java.util.Hashtable |
getLocalContextProperties()
ADVANCED:
Return the properties that will be used to create the initial context
for local JNDI access.
|
int |
getNamingServiceType()
PUBLIC:
Return the type of naming service used to look up remote connections to other
service instances.
|
java.lang.String |
getPassword()
PUBLIC:
Return the password used as the value to the SECURITY_CREDENTIALS key in
the cached context properties.
|
RemoteCommandManager |
getRemoteCommandManager()
INTERNAL:
|
java.util.Hashtable |
getRemoteContextProperties()
ADVANCED:
Return the cached properties that will be used to create the initial context
when doing remote JNDI lookups.
|
javax.naming.Context |
getRemoteHostContext(java.lang.String remoteHostURL)
INTERNAL:
Return the context used for looking up in the JNDI space of the specified remote URL.
|
java.lang.String |
getUserName()
PUBLIC:
Return the user name used as the value to the SECURITY_PRINCIPAL key in the
cached context properties.
|
protected boolean |
hasPassword()
INTERNAL:
|
void |
initialize()
INTERNAL:
Initialize default properties.
|
void |
removeAllConnectionsToExternalServices()
INTERNAL:
Remove all remote connections from the list.
|
void |
removeConnectionToExternalService(org.eclipse.persistence.internal.sessions.coordination.RemoteConnection connection)
INTERNAL:
Remove a remote connection from the list of connections to receive remote commands.
|
abstract void |
removeLocalConnection()
ADVANCED:
Remove the local connection from remote accesses.
|
void |
setConfig(java.lang.String config)
Generic API to allow config to be set.
|
void |
setEncryptedPassword(java.lang.String encryptedPassword)
ADVANCED:
Set the encrypted password used as the value to the SECURITY_CREDENTIALS key in the
cached context properties.
|
void |
setEncryptionClassName(java.lang.String encryptionClassName)
INTERNAL SECURITY:
Set encryption class that will be loaded by the SecurableObjectHolder
|
void |
setInitialContextFactoryName(java.lang.String contextFactoryName)
ADVANCED:
Set the context factory name used as the value to the INITIAL_CONTEXT_FACTORY
key in the cached context properties.
|
void |
setLocalContextProperties(java.util.Hashtable properties)
ADVANCED:
Set the properties that will be used to create the initial context
for local JNDI access.
|
void |
setNamingServiceType(int serviceType)
ADVANCED:
Set the type of naming service used to look up remote connections to other
service instances.
|
void |
setPassword(java.lang.String password)
ADVANCED:
Set the password used as the value to the SECURITY_CREDENTIALS key in the
cached context properties.
|
void |
setRemoteCommandManager(RemoteCommandManager rcm)
INTERNAL:
|
void |
setRemoteContextProperties(java.util.Hashtable properties)
ADVANCED:
Set the cached properties that will be used to create the initial context
when doing remote JNDI lookups.
|
void |
setShouldRemoveConnectionOnError(boolean shouldRemoveConnectionOnError)
PUBLIC:
Set whether connections to remote services should be disconnected when an
error occurs.
|
void |
setUserName(java.lang.String userName)
ADVANCED:
Set the user name used as the value to the SECURITY_PRINCIPAL key in the
cached context properties.
|
boolean |
shouldRemoveConnectionOnError()
PUBLIC:
Return whether connections to remote services should be disconnected when an
error occurs.
|
protected org.eclipse.persistence.internal.sessions.coordination.RemoteConnection localConnection
protected RemoteCommandManager rcm
protected int namingServiceType
protected java.util.Hashtable localContextProperties
protected java.util.Hashtable remoteContextProperties
protected boolean shouldRemoveConnectionOnError
protected java.util.Hashtable connectionsToExternalServices
protected org.eclipse.persistence.internal.security.SecurableObjectHolder securableObjectHolder
public static final boolean DEFAULT_REMOVE_CONNECTION_ON_ERROR_MODE
public static final int JNDI_NAMING_SERVICE
public static final int REGISTRY_NAMING_SERVICE
public static final java.lang.String DEFAULT_URL_PROTOCOL
public static final java.lang.String DEFAULT_IIOP_URL_PROTOCOL
public static final java.lang.String DEFAULT_URL_PORT
public static final java.lang.String DEFAULT_IIOP_URL_PORT
public static final int DEFAULT_NAMING_SERVICE
public static final java.lang.String DEFAULT_CONTEXT_FACTORY
public static final java.lang.String DEFAULT_DEDICATED_CONNECTION_KEY
public static final java.lang.String DEFAULT_DEDICATED_CONNECTION_VALUE
public static final java.lang.String DEFAULT_USER_NAME
public abstract org.eclipse.persistence.internal.sessions.coordination.RemoteConnection createConnection(ServiceId serviceId)
public void createConnections()
public void connectBackToRemote(org.eclipse.persistence.internal.sessions.coordination.RemoteConnection connection) throws java.lang.Exception
java.lang.Exception
public org.eclipse.persistence.internal.sessions.coordination.RemoteConnection getConnectionToLocalHost()
public abstract void createLocalConnection()
public int getNamingServiceType()
public void setNamingServiceType(int serviceType)
public java.lang.String getUserName()
public void setUserName(java.lang.String userName)
public java.lang.String getPassword()
public java.lang.String getEncryptedPassword()
public void setPassword(java.lang.String password)
public void setEncryptedPassword(java.lang.String encryptedPassword)
public java.lang.String getInitialContextFactoryName()
public void setInitialContextFactoryName(java.lang.String contextFactoryName)
public javax.naming.Context getContext(java.util.Hashtable contextProperties)
public java.util.Hashtable getRemoteContextProperties()
public void setRemoteContextProperties(java.util.Hashtable properties)
public java.util.Hashtable getLocalContextProperties()
public void setLocalContextProperties(java.util.Hashtable properties)
public RemoteCommandManager getRemoteCommandManager()
public void setRemoteCommandManager(RemoteCommandManager rcm)
public void addConnectionToExternalService(org.eclipse.persistence.internal.sessions.coordination.RemoteConnection connection)
public void removeConnectionToExternalService(org.eclipse.persistence.internal.sessions.coordination.RemoteConnection connection)
public void removeAllConnectionsToExternalServices()
public java.util.Map<java.lang.String,org.eclipse.persistence.internal.sessions.coordination.RemoteConnection> getConnectionsToExternalServices()
public java.util.Map<java.lang.String,org.eclipse.persistence.internal.sessions.coordination.RemoteConnection> getConnectionsToExternalServicesForCommandPropagation()
public void setShouldRemoveConnectionOnError(boolean shouldRemoveConnectionOnError)
public boolean shouldRemoveConnectionOnError()
public void setEncryptionClassName(java.lang.String encryptionClassName)
protected boolean hasPassword()
public void initialize()
protected java.lang.String encrypt(java.lang.String pwd)
protected java.lang.String decrypt(java.lang.String encryptedPwd)
public javax.naming.Context getRemoteHostContext(java.lang.String remoteHostURL)
public DiscoveryManager createDiscoveryManager()
public void discardConnections()
public abstract void removeLocalConnection()
public void setConfig(java.lang.String config)