Class SocketProviderBuilder
- java.lang.Object
-
- com.tangosol.coherence.config.builder.SocketProviderBuilder
-
- All Implemented Interfaces:
ParameterizedBuilder<com.oracle.coherence.common.net.SocketProvider>
public class SocketProviderBuilder extends Object implements ParameterizedBuilder<com.oracle.coherence.common.net.SocketProvider>
SocketProviderBuilder
enables lazy instantiation of SocketProvider. Builder includes methods that allows one to specify whether to get a datagram or demultiplexedSocketProvider
and what subport to use for the socket provider.- Since:
- Coherence 12.2.1.1
- Author:
- jf 2015.11.11
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.tangosol.coherence.config.builder.ParameterizedBuilder
ParameterizedBuilder.ReflectionSupport
-
-
Field Summary
Fields Modifier and Type Field Description static String
UNNAMED_PROVIDER_ID
Default id for unnamed socket providers.
-
Constructor Summary
Constructors Constructor Description SocketProviderBuilder(com.oracle.coherence.common.net.SocketProvider provider, boolean fCanUseGlobal)
Wrapper an existingSocketProvider
into a Builder so it can be registered in cluster BuilderRegistry.SocketProviderBuilder(String sId, SocketProviderFactory.Dependencies deps, boolean fCanUseGlobal)
Construct aSocketProviderBuilder
from its definition id and its dependencies.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canUseGlobal()
Returnstrue
if theSocketProviderFactory
can use the global provider builder over this builder, if a global builder is present.DatagramSocketProvider
getDatagramSocketProvider(int nSubport)
Return an instance of the specified DatagramSocketProvider, creating it if necessary.com.oracle.coherence.common.net.SocketProvider
getDemultiplexedSocketProvider(int nSubport)
Return a Demultiplexed Socket providerSocketProviderFactory.Dependencies
getDependencies()
Return either an anonymous SocketProviderFactory dependencies for an inlined socket-provider or the global SocketProviderFactory dependencies initialized from cluster socket-providers definitions.String
getId()
Return the identifier for SocketProvider built by this builder.com.oracle.coherence.common.net.SSLSettings
getSSLSettings()
Return SSLSettings forSocketProviderBuilder
.com.oracle.coherence.common.net.SocketProvider
realize(ParameterResolver resolver, ClassLoader loader, ParameterList listParameters)
Realizes (creates if necessary) an instance of a object of type T, using the providedParameterResolver
to resolve values any referencedParameter
s.
-
-
-
Field Detail
-
UNNAMED_PROVIDER_ID
public static String UNNAMED_PROVIDER_ID
Default id for unnamed socket providers.
-
-
Constructor Detail
-
SocketProviderBuilder
public SocketProviderBuilder(String sId, SocketProviderFactory.Dependencies deps, boolean fCanUseGlobal)
Construct aSocketProviderBuilder
from its definition id and its dependencies.- Parameters:
sId
- provider definition id.UNNAMED_PROVIDER_ID
indicates an inlined anonymous socket providerdeps
- SocketProvider dependenciesfCanUseGlobal
-true
if the global provider builder can be used over this builder
-
SocketProviderBuilder
public SocketProviderBuilder(com.oracle.coherence.common.net.SocketProvider provider, boolean fCanUseGlobal)
Wrapper an existingSocketProvider
into a Builder so it can be registered in cluster BuilderRegistry.- Parameters:
provider
- aSocketProvider
fCanUseGlobal
-true
if the global provider builder can be used over this builder
-
-
Method Detail
-
getDependencies
public SocketProviderFactory.Dependencies getDependencies()
Return either an anonymous SocketProviderFactory dependencies for an inlined socket-provider or the global SocketProviderFactory dependencies initialized from cluster socket-providers definitions.- Returns:
SocketProviderFactory.Dependencies
for this builder
-
getId
public String getId()
Return the identifier for SocketProvider built by this builder.- Returns:
- the identifier for
SocketProvider
returned by this builder.
-
getDemultiplexedSocketProvider
public com.oracle.coherence.common.net.SocketProvider getDemultiplexedSocketProvider(int nSubport)
Return a Demultiplexed Socket provider- Parameters:
nSubport
- subport for demultiplexed socket provider.- Returns:
- the provider
- Throws:
NullPointerException
- if this buildersf_deps
field isnull
-
getDatagramSocketProvider
public DatagramSocketProvider getDatagramSocketProvider(int nSubport)
Return an instance of the specified DatagramSocketProvider, creating it if necessary.- Parameters:
nSubport
- subport for a demultiplexed socket provider.- Returns:
- the provider
- Throws:
NullPointerException
- if this buildersf_deps
field isnull
-
getSSLSettings
public com.oracle.coherence.common.net.SSLSettings getSSLSettings()
Return SSLSettings forSocketProviderBuilder
.If this builder's
canUseGlobal()
method returns and there is a globalSocketProviderBuilder
configured, then the result of calling the global builder's getSSLSettings() method will be returned.- Returns:
- the sslSettings if the socket provider builder has a ssl settings directly or via delegate.
- Throws:
NullPointerException
- if the global builder is not used and this buildersf_deps
field isnull
-
canUseGlobal
public boolean canUseGlobal()
Returnstrue
if theSocketProviderFactory
can use the global provider builder over this builder, if a global builder is present.- Returns:
true
if theSocketProviderFactory
can use the global provider builder over this builder
-
realize
public com.oracle.coherence.common.net.SocketProvider realize(ParameterResolver resolver, ClassLoader loader, ParameterList listParameters)
Description copied from interface:ParameterizedBuilder
Realizes (creates if necessary) an instance of a object of type T, using the providedParameterResolver
to resolve values any referencedParameter
s.- Specified by:
realize
in interfaceParameterizedBuilder<com.oracle.coherence.common.net.SocketProvider>
- Parameters:
resolver
- theParameterResolver
for resolving namedParameter
sloader
- theClassLoader
for loading any necessary classes and ifnull
theClassLoader
used to load the builder will be used insteadlistParameters
- an optionalParameterList
(may benull
) to be used for realizing the instance, eg: used as constructor parameters- Returns:
- an instance of T
-
-