Class SocketOptions

  • All Implemented Interfaces:
    XmlConfigurable, SocketOptions

    public class SocketOptions
    extends com.oracle.coherence.common.net.SocketSettings
    implements XmlConfigurable
    SocketOptions provides a means to configure the various aspects of Sockets. Unlike java.net.SocketOptions, unset options will result in a value of null when queried via getOption.
    Since:
    Coherence 3.6
    Author:
    mf 2010.05.20
    • Field Detail

      • m_xml

        protected XmlElement m_xml
        The configuration.
    • Constructor Detail

      • SocketOptions

        public SocketOptions()
    • Method Detail

      • isConfigured

        public boolean isConfigured()
        Return true iff the XmlSocketOptions have been configured with any options.
        Returns:
        true iff the XmlSocketOptions have been configured with any options.
      • apply

        public void apply​(Socket socket)
                   throws SocketException
        Configure the specified socket.
        Parameters:
        socket - the socket to configure
        Throws:
        SocketException - if an I/O error occurs
      • setConfig

        @Deprecated
        public void setConfig​(XmlElement xml)
        Deprecated.
        Specify the configuration for the object.
        Specified by:
        setConfig in interface XmlConfigurable
        Parameters:
        xml - the XML configuration for the object
      • copyOptions

        public void copyOptions​(SocketOptions options)
                         throws SocketException
        Copy the options in the specified SocketOptions into this SocketOptions.
        Parameters:
        options - the options to copy
        Throws:
        SocketException - if an error occurs
      • load

        @Deprecated
        public static SocketOptions load​(XmlElement xml)
        Deprecated.
        Parse the supplied XML and return the corresponding SocketOptions.
        Parameters:
        xml - the xml configuration
        Returns:
        the options, or null if none were identified
      • apply

        public static void apply​(SocketOptions options,
                                 Socket socket)
                          throws SocketException
        Apply the specified options to a socket.
        Parameters:
        options - the options to apply
        socket - the socket to configure
        Throws:
        SocketException - if an I/O error occurs