Class 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 demultiplexed SocketProvider and what subport to use for the socket provider.
    Since:
    Coherence 12.2.1.1
    Author:
    jf 2015.11.11
    • 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 a SocketProviderBuilder from its definition id and its dependencies.
        Parameters:
        sId - provider definition id. UNNAMED_PROVIDER_ID indicates an inlined anonymous socket provider
        deps - SocketProvider dependencies
        fCanUseGlobal - 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 existing SocketProvider into a Builder so it can be registered in cluster BuilderRegistry.
        Parameters:
        provider - a SocketProvider
        fCanUseGlobal - true if the global provider builder can be used over this builder
    • Method Detail

      • 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 builders f_deps field is null
      • 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 builders f_deps field is null
      • getSSLSettings

        public com.oracle.coherence.common.net.SSLSettings getSSLSettings()
        Return SSLSettings for SocketProviderBuilder.

        If this builder's canUseGlobal() method returns and there is a global SocketProviderBuilder 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 builders f_deps field is null
      • canUseGlobal

        public boolean canUseGlobal()
        Returns true if the SocketProviderFactory can use the global provider builder over this builder, if a global builder is present.
        Returns:
        true if the SocketProviderFactory can use the global provider builder over this builder