Class SocketOptions

java.lang.Object
com.oracle.coherence.common.net.SocketSettings
com.tangosol.net.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 Details

    • m_xml

      protected XmlElement m_xml
      The configuration.
  • Constructor Details

    • SocketOptions

      public SocketOptions()
  • Method Details

    • 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(ServerSocket socket) throws SocketException
      Configure the specified socket.
      Parameters:
      socket - the socket to configure
      Throws:
      SocketException - if an I/O error occurs
    • 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
    • apply

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

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

      @Deprecated public XmlElement getConfig()
      Deprecated.
      Determine the current configuration of the object.
      Specified by:
      getConfig in interface XmlConfigurable
      Returns:
      the XML configuration or null
    • 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, ServerSocket 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
    • 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
    • apply

      public static void apply(SocketOptions options, DatagramSocket 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
    • apply

      public void apply(SocketOptions options, MulticastSocket 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