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
  • Field Details

    • 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:
    • 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:
  • Constructor Details

    • SocketProviderFactory

      public SocketProviderFactory()
      Construct a SocketProviderFactory
    • SocketProviderFactory

      public SocketProviderFactory(SocketProviderFactory.Dependencies dependencies)
      Construct a SocketProviderFactory.
      Parameters:
      dependencies - SocketProviderFactory dependencies or null
  • Method Details

    • getDependencies

      public SocketProviderFactory.Dependencies getDependencies()
      Get SocketProviderDependencies object
      Returns:
      SocketProviderDependencies
    • getDefaultSocketProviderBuilder

      public SocketProviderBuilder getDefaultSocketProviderBuilder()
      Return the default SocketProviderBuilder.
      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 a SocketProviderBuilder 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 a SocketProviderBuilder configured from the specified xml.
      Parameters:
      xml - provider definition, or null for the default provider
      fCanUseGlobal - 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 - anonymous SocketProviderFactory.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 provider
      nSubport - 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 or UNNAMED_PROVIDER_ID for inlined, anonymous socket provider
      deps - inlined socket provider dependencies, must be non-null if sId is set to UNNAMED_PROVIDER_ID
      nSubport - subport for demultiplexed socket provider
      fCanUseGlobal - 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 this SocketProviderBuilder
      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 provider
      nSubport - 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 or UNNAMED_PROVIDER_ID for inlined, anonymous socket provider
      deps - inlined socket provider dependencies, must be non-null if sId is set to UNNAMED_PROVIDER_ID
      nSubport - subport for DatagramSocketProvider.
      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 this SocketProviderBuilder
      nSubport - subport for DatagramSocketProvider.
      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 global SocketProviderBuilder or null if no global provider has been set.
      Returns:
      the global SocketProviderBuilder or null if no global provider has been set
    • setGlobalSocketProviderBuilder

      public static void setGlobalSocketProviderBuilder(SocketProviderBuilder builder)
      Set the global SocketProviderBuilder.
      Parameters:
      builder - the global SocketProviderBuilder
    • setGlobalSocketProvider

      public static void setGlobalSocketProvider(SocketProviderBuilder builder)
      Set the global SocketProviderBuilder.
      Parameters:
      builder - the global SocketProviderBuilder
    • getSocketProviderFactory

      public static SocketProviderFactory getSocketProviderFactory(ProcessingContext ctx, XmlElement xml)
      Return the cluster's SocketProviderFactory.
      Parameters:
      ctx - Cluster operational context
      xml - 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 via SSLSocketProvider.Dependencies
      Parameters:
      depsSSL - SSL Dependencies info
      Returns:
      a new SSLSettings initialized via depsSSL
    • ensureSocketProvider

      protected com.oracle.coherence.common.net.SocketProvider ensureSocketProvider(String sId, SocketProviderFactory.Dependencies deps, int nSubport)
      Create SocketProvider
      Parameters:
      sId - SocketProviderId
      deps - Dependencies for the given SocketProvider
      nSubport - 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)
      Parameters:
      sId - DatagramSocketProviderId
      providerDeps - Dependencies for the given DatagramSocketProvider
      nSubport - Subport for Demultiplexed socket provider. If it is 0, then it implies Multiplexed socket provider.
      Returns:
      the DatagramSocketProvider
    • toString

      public String toString()
      Overrides:
      toString in class Object