Package com.tangosol.net
Class SocketProviderFactory
- java.lang.Object
-
- com.tangosol.net.SocketProviderFactory
-
public class SocketProviderFactory extends Object
The SocketProviderFactory produces SocketProviders.- Since:
- Coherence 3.6
- Author:
- mf, jh, bb 2010.04.21
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SocketProviderFactory.DefaultDependencies
DefaultDependencies is a basic implementation of the Dependencies interface.static interface
SocketProviderFactory.Dependencies
Dependencies specifies all dependency requirements of the SocketProviderFactory.
-
Field Summary
Fields Modifier and Type Field Description static DatagramSocketProvider
DEFAULT_DATAGRAM_SOCKET_PROVIDER
The factory's default Datagram SocketProvider.static com.oracle.coherence.common.net.SocketProvider
DEFAULT_LEGACY_SOCKET_PROVIDER
The factory's default legacy SocketProvider.static com.oracle.coherence.common.net.SocketProvider
DEFAULT_SOCKET_PROVIDER
The factory's default SocketProvider.protected SocketProviderFactory.Dependencies
m_Dependencies
Dependenciesprotected Map<String,DatagramSocketProvider>
m_mapDatagramSocketProvider
A map of instantiated datagram socket providers, keyed by id.protected Map<String,com.oracle.coherence.common.net.SocketProvider>
m_mapSocketProvider
A map of instantiated socket providers, keyed by id.static String
PROP_GLOBAL_PROVIDER
The name of the system property used to set the global socket provider id.static String
UNNAMED_PROVIDER_ID
Default id for unnamed socket and datagram socket providers
-
Constructor Summary
Constructors Constructor Description SocketProviderFactory()
Construct a SocketProviderFactorySocketProviderFactory(SocketProviderFactory.Dependencies dependencies)
Construct a SocketProviderFactory.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static 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 SocketProviderDatagramSocketProvider
getDatagramSocketProvider(XmlElement xml, int nSubport)
Deprecated.DatagramSocketProvider
getDatagramSocketProvider(String sId, SocketProviderFactory.Dependencies deps, int nSubport, boolean fCanUseGlobal)
Return an instance of the specified DatagramSocketProvider, creating it if necessary.DatagramSocketProvider
getDefaultDatagramSocketProvider(SocketProviderBuilder builder, int nSubport)
Return an instance of the specified DatagramSocketProvider, creating it if necessary.SocketProviderBuilder
getDefaultSocketProviderBuilder()
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 providerSocketProviderFactory.Dependencies
getDependencies()
Get SocketProviderDependencies objectstatic SocketProviderBuilder
getGlobalSocketProviderBuilder()
Returns the globalSocketProviderBuilder
ornull
if no global provider has been set.com.oracle.coherence.common.net.SocketProvider
getLegacySocketProvider(XmlElement xml)
Deprecated.com.oracle.coherence.common.net.SocketProvider
getSocketProvider(XmlElement xml)
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 providerSocketProviderBuilder
getSocketProviderBuilder(XmlElement xml)
Deprecated.SocketProviderBuilder
getSocketProviderBuilder(XmlElement xml, boolean fCanUseGlobal)
Deprecated.static SocketProviderFactory
getSocketProviderFactory(ProcessingContext ctx, XmlElement xml)
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
setGlobalSocketProvider(SocketProviderBuilder builder)
Set the globalSocketProviderBuilder
.static void
setGlobalSocketProviderBuilder(SocketProviderBuilder builder)
Set the globalSocketProviderBuilder
.String
toString()
-
-
-
Field Detail
-
m_mapSocketProvider
protected Map<String,com.oracle.coherence.common.net.SocketProvider> m_mapSocketProvider
A map of instantiated socket providers, keyed by id.
-
m_mapDatagramSocketProvider
protected Map<String,DatagramSocketProvider> m_mapDatagramSocketProvider
A map of instantiated datagram socket providers, keyed by id.
-
m_Dependencies
protected SocketProviderFactory.Dependencies m_Dependencies
Dependencies
-
DEFAULT_SOCKET_PROVIDER
public static final com.oracle.coherence.common.net.SocketProvider DEFAULT_SOCKET_PROVIDER
The factory's default SocketProvider.
-
DEFAULT_LEGACY_SOCKET_PROVIDER
public static final com.oracle.coherence.common.net.SocketProvider DEFAULT_LEGACY_SOCKET_PROVIDER
The factory's default legacy SocketProvider.
-
DEFAULT_DATAGRAM_SOCKET_PROVIDER
public static final DatagramSocketProvider DEFAULT_DATAGRAM_SOCKET_PROVIDER
The factory's default Datagram SocketProvider.
-
UNNAMED_PROVIDER_ID
public static final String UNNAMED_PROVIDER_ID
Default id for unnamed socket and datagram socket providers- See Also:
- Constant Field Values
-
PROP_GLOBAL_PROVIDER
public static final String PROP_GLOBAL_PROVIDER
The name of the system property used to set the global socket provider id.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SocketProviderFactory
public SocketProviderFactory()
Construct a SocketProviderFactory
-
SocketProviderFactory
public SocketProviderFactory(SocketProviderFactory.Dependencies dependencies)
Construct a SocketProviderFactory.- Parameters:
dependencies
- SocketProviderFactory dependencies or null
-
-
Method Detail
-
getDependencies
public SocketProviderFactory.Dependencies getDependencies()
Get SocketProviderDependencies object- Returns:
- SocketProviderDependencies
-
getDefaultSocketProviderBuilder
public SocketProviderBuilder 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 public SocketProviderBuilder getSocketProviderBuilder(XmlElement xml)
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 public com.oracle.coherence.common.net.SocketProvider getSocketProvider(XmlElement xml)
Deprecated.Return a Socket provider- Parameters:
xml
- provider definition, or null for the default provider- Returns:
- the provider
-
getSocketProvider
public com.oracle.coherence.common.net.SocketProvider getSocketProvider(String sId)
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 public DatagramSocketProvider getDatagramSocketProvider(XmlElement xml, int nSubport)
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 public com.oracle.coherence.common.net.SSLSettings getSSLSettings(XmlElement xml)
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
public com.oracle.coherence.common.net.SSLSettings getSSLSettings(SocketProviderBuilder builder)
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
public static SocketProviderBuilder 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
public static void setGlobalSocketProviderBuilder(SocketProviderBuilder builder)
Set the globalSocketProviderBuilder
.- Parameters:
builder
- the globalSocketProviderBuilder
-
setGlobalSocketProvider
public static void setGlobalSocketProvider(SocketProviderBuilder builder)
Set the globalSocketProviderBuilder
.- Parameters:
builder
- the globalSocketProviderBuilder
-
getSocketProviderFactory
public static SocketProviderFactory getSocketProviderFactory(ProcessingContext ctx, XmlElement xml)
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
-
-