Package com.tangosol.net
Class SocketProviderFactory
java.lang.Object
com.tangosol.net.SocketProviderFactory
The SocketProviderFactory produces SocketProviders.
- Since:
- Coherence 3.6
- Author:
- mf, jh, bb 2010.04.21
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
DefaultDependencies is a basic implementation of the Dependencies interface.static interface
Dependencies specifies all dependency requirements of the SocketProviderFactory. -
Field Summary
Modifier and TypeFieldDescriptionstatic final DatagramSocketProvider
The factory's default Datagram SocketProvider.static final com.oracle.coherence.common.net.SocketProvider
The factory's default legacy SocketProvider.static final com.oracle.coherence.common.net.SocketProvider
The factory's default SocketProvider.protected SocketProviderFactory.Dependencies
Dependenciesprotected Map
<String, DatagramSocketProvider> A map of instantiated datagram socket providers, keyed by id.A map of instantiated socket providers, keyed by id.static final String
The name of the system property used to set the global socket provider id.static final String
Default id for unnamed socket and datagram socket providers -
Constructor Summary
ConstructorDescriptionConstruct a SocketProviderFactorySocketProviderFactory
(SocketProviderFactory.Dependencies dependencies) Construct a SocketProviderFactory. -
Method Summary
Modifier and TypeMethodDescriptionstatic com.oracle.coherence.common.net.SSLSettings
createSSLSettings
(com.oracle.coherence.common.net.SSLSocketProvider.Dependencies depsSSL) Return an SSLSettings initialize viaSSLSocketProvider.Dependencies
protected DatagramSocketProvider
ensureDatagramSocketProvider
(String sId, SocketProviderFactory.Dependencies providerDeps, int nSubport) Create aDatagramSocketProvider
protected com.oracle.coherence.common.net.SocketProvider
ensureSocketProvider
(String sId, SocketProviderFactory.Dependencies deps, int nSubport) Create SocketProvidergetDatagramSocketProvider
(XmlElement xml, int nSubport) Deprecated.getDatagramSocketProvider
(String sId, SocketProviderFactory.Dependencies deps, int nSubport, boolean fCanUseGlobal) Return an instance of the specified DatagramSocketProvider, creating it if necessary.getDefaultDatagramSocketProvider
(SocketProviderBuilder builder, int nSubport) Return an instance of the specified DatagramSocketProvider, creating it if necessary.Return the defaultSocketProviderBuilder
.com.oracle.coherence.common.net.SocketProvider
getDemultiplexedSocketProvider
(SocketProviderBuilder builder, int nSubport) Return a Demultiplexed Socket providercom.oracle.coherence.common.net.SocketProvider
getDemultiplexedSocketProvider
(XmlElement xml, int nSubport) Deprecated.com.oracle.coherence.common.net.SocketProvider
getDemultiplexedSocketProvider
(String sId, SocketProviderFactory.Dependencies deps, int nSubport, boolean fCanUseGlobal) Return a Demultiplexed Socket providerGet SocketProviderDependencies objectstatic SocketProviderBuilder
Returns the globalSocketProviderBuilder
ornull
if no global provider has been set.com.oracle.coherence.common.net.SocketProvider
Deprecated.com.oracle.coherence.common.net.SocketProvider
Deprecated.com.oracle.coherence.common.net.SocketProvider
getSocketProvider
(String sId) Return a Socket providercom.oracle.coherence.common.net.SocketProvider
getSocketProvider
(String sId, SocketProviderFactory.Dependencies deps, int nSubport) Return a Socket providerDeprecated.getSocketProviderBuilder
(XmlElement xml, boolean fCanUseGlobal) Deprecated.static SocketProviderFactory
Return the cluster'sSocketProviderFactory
.com.oracle.coherence.common.net.SSLSettings
getSSLSettings
(com.oracle.coherence.common.net.SocketProvider socketProvider) Return SSLSettings for the specified SocketProvider.com.oracle.coherence.common.net.SSLSettings
getSSLSettings
(SocketProviderBuilder builder) Return SSLSettings for the specified SocketProviderBuilder.com.oracle.coherence.common.net.SSLSettings
getSSLSettings
(XmlElement xml) Deprecated.static void
Set the globalSocketProviderBuilder
.static void
Set the globalSocketProviderBuilder
.toString()
-
Field Details
-
m_mapSocketProvider
A map of instantiated socket providers, keyed by id. -
m_mapDatagramSocketProvider
A map of instantiated datagram socket providers, keyed by id. -
m_Dependencies
Dependencies -
DEFAULT_SOCKET_PROVIDER
public static final com.oracle.coherence.common.net.SocketProvider DEFAULT_SOCKET_PROVIDERThe factory's default SocketProvider. -
DEFAULT_LEGACY_SOCKET_PROVIDER
public static final com.oracle.coherence.common.net.SocketProvider DEFAULT_LEGACY_SOCKET_PROVIDERThe factory's default legacy SocketProvider. -
DEFAULT_DATAGRAM_SOCKET_PROVIDER
The factory's default Datagram SocketProvider. -
UNNAMED_PROVIDER_ID
Default id for unnamed socket and datagram socket providers- See Also:
-
PROP_GLOBAL_PROVIDER
The name of the system property used to set the global socket provider id.- See Also:
-
-
Constructor Details
-
SocketProviderFactory
public SocketProviderFactory()Construct a SocketProviderFactory -
SocketProviderFactory
Construct a SocketProviderFactory.- Parameters:
dependencies
- SocketProviderFactory dependencies or null
-
-
Method Details
-
getDependencies
Get SocketProviderDependencies object- Returns:
- SocketProviderDependencies
-
getDefaultSocketProviderBuilder
Return the defaultSocketProviderBuilder
.- Returns:
- the default
SocketProviderBuilder
-
getLegacySocketProvider
@Deprecated public com.oracle.coherence.common.net.SocketProvider getLegacySocketProvider(XmlElement xml) Deprecated.Return a Socket provider. Only there for Proxy till they move to use MultiplexedSocketProvider- Parameters:
xml
- provider definition, or null for the default provider- Returns:
- the provider
-
getSocketProviderBuilder
Deprecated.Return aSocketProviderBuilder
configured from the specified xml.- Parameters:
xml
- provider definition, or null for the default provider- Returns:
- the
SocketProviderBuilder
-
getSocketProviderBuilder
@Deprecated public SocketProviderBuilder getSocketProviderBuilder(XmlElement xml, boolean fCanUseGlobal) Deprecated.Return aSocketProviderBuilder
configured from the specified xml.- Parameters:
xml
- provider definition, or null for the default providerfCanUseGlobal
-true
to allow use of a global provider- Returns:
- the
SocketProviderBuilder
-
getSocketProvider
Deprecated.Return a Socket provider- Parameters:
xml
- provider definition, or null for the default provider- Returns:
- the provider
-
getSocketProvider
Return a Socket provider- Parameters:
sId
- provider name defined in <socket-providers>- Returns:
- the provider
-
getSocketProvider
public com.oracle.coherence.common.net.SocketProvider getSocketProvider(String sId, SocketProviderFactory.Dependencies deps, int nSubport) Return a Socket provider- Parameters:
sId
- provider name defined in <socket-providers>deps
- anonymousSocketProviderFactory.Dependencies
nSubport
- Sub-port for De-multiplexed socket provider. If it is 0, then it implies Multiplexed socket provider.- Returns:
- the provider
-
getDemultiplexedSocketProvider
@Deprecated public com.oracle.coherence.common.net.SocketProvider getDemultiplexedSocketProvider(XmlElement xml, int nSubport) Deprecated.Return a Demultiplexed Socket provider- Parameters:
xml
- provider definition, or null for the default providernSubport
- subport for demultiplexed socket provider.- Returns:
- the provider
-
getDemultiplexedSocketProvider
public com.oracle.coherence.common.net.SocketProvider getDemultiplexedSocketProvider(String sId, SocketProviderFactory.Dependencies deps, int nSubport, boolean fCanUseGlobal) Return a Demultiplexed Socket provider- Parameters:
sId
- provider definition identifier orUNNAMED_PROVIDER_ID
for inlined, anonymous socket providerdeps
- inlined socket provider dependencies, must be non-null ifsId
is set toUNNAMED_PROVIDER_ID
nSubport
- subport for demultiplexed socket providerfCanUseGlobal
-true
if the global socket provider can be used- Returns:
- a
DemultiplexedSocketProvider
based on method parameters.
-
getDemultiplexedSocketProvider
public com.oracle.coherence.common.net.SocketProvider getDemultiplexedSocketProvider(SocketProviderBuilder builder, int nSubport) Return a Demultiplexed Socket provider- Parameters:
builder
- use socket provider id and dependencies from thisSocketProviderBuilder
nSubport
- subport for demultiplexed socket provider.- Returns:
- a
DemultiplexedSocketProvider
based on method parameters.
-
getDatagramSocketProvider
Deprecated.Return an instance of the specified DatagramSocketProvider, creating it if necessary.- Parameters:
xml
- the provider definition, or null for the default providernSubport
- subport for a demultiplexed socket provider.- Returns:
- the provider
-
getDatagramSocketProvider
public DatagramSocketProvider getDatagramSocketProvider(String sId, SocketProviderFactory.Dependencies deps, int nSubport, boolean fCanUseGlobal) Return an instance of the specified DatagramSocketProvider, creating it if necessary.- Parameters:
sId
- provider definition identifier orUNNAMED_PROVIDER_ID
for inlined, anonymous socket providerdeps
- inlined socket provider dependencies, must be non-null ifsId
is set toUNNAMED_PROVIDER_ID
nSubport
- subport forDatagramSocketProvider
.fCanUseGlobal
-true
if the global socket provider can be used- Returns:
- a
DatagramSocketProvider
configured via method parameters
-
getDefaultDatagramSocketProvider
public DatagramSocketProvider getDefaultDatagramSocketProvider(SocketProviderBuilder builder, int nSubport) Return an instance of the specified DatagramSocketProvider, creating it if necessary.- Parameters:
builder
- use socket provider id and dependencies from thisSocketProviderBuilder
nSubport
- subport forDatagramSocketProvider
.- Returns:
- a
DatagramSocketProvider
configured via method parameters
-
getSSLSettings
Deprecated.Return an instance of SSLSettings from the specified xml.- Parameters:
xml
- the provider definition, or null for the default provider- Returns:
- the sslSettings
-
getSSLSettings
public com.oracle.coherence.common.net.SSLSettings getSSLSettings(com.oracle.coherence.common.net.SocketProvider socketProvider) Return SSLSettings for the specified SocketProvider.- Parameters:
socketProvider
- the socketProvider- Returns:
- the sslSettings if the socket provider is an instance of SSLSocketProvider or null
-
getSSLSettings
Return SSLSettings for the specified SocketProviderBuilder.- Parameters:
builder
- the socketProviderBuilder- Returns:
- the sslSettings if the socket provider builder has a ssl settings directly or via delegate.
-
getGlobalSocketProviderBuilder
Returns the globalSocketProviderBuilder
ornull
if no global provider has been set.- Returns:
- the global
SocketProviderBuilder
ornull
if no global provider has been set
-
setGlobalSocketProviderBuilder
Set the globalSocketProviderBuilder
.- Parameters:
builder
- the globalSocketProviderBuilder
-
setGlobalSocketProvider
Set the globalSocketProviderBuilder
.- Parameters:
builder
- the globalSocketProviderBuilder
-
getSocketProviderFactory
Return the cluster'sSocketProviderFactory
.- Parameters:
ctx
- Cluster operational contextxml
- socket-provider xml fragment being processed.- Returns:
- the cluster's
SocketProviderFactory
-
createSSLSettings
public static com.oracle.coherence.common.net.SSLSettings createSSLSettings(com.oracle.coherence.common.net.SSLSocketProvider.Dependencies depsSSL) Return an SSLSettings initialize viaSSLSocketProvider.Dependencies
- Parameters:
depsSSL
- SSL Dependencies info- Returns:
- a new
SSLSettings
initialized viadepsSSL
-
ensureSocketProvider
protected com.oracle.coherence.common.net.SocketProvider ensureSocketProvider(String sId, SocketProviderFactory.Dependencies deps, int nSubport) Create SocketProvider- Parameters:
sId
- SocketProviderIddeps
- Dependencies for the given SocketProvidernSubport
- Subport for Demultiplexed socket provider. If it is 0, then it implies Multiplexed socket provider.- Returns:
- the SocketProvider
-
ensureDatagramSocketProvider
protected DatagramSocketProvider ensureDatagramSocketProvider(String sId, SocketProviderFactory.Dependencies providerDeps, int nSubport) Create aDatagramSocketProvider
- Parameters:
sId
- DatagramSocketProviderIdproviderDeps
- Dependencies for the given DatagramSocketProvidernSubport
- Subport for Demultiplexed socket provider. If it is 0, then it implies Multiplexed socket provider.- Returns:
- the DatagramSocketProvider
-
toString
-