Package com.tangosol.net
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 Summary
Fields Modifier and Type Field Description protected XmlElement
m_xml
The configuration.-
Fields inherited from interface java.net.SocketOptions
IP_MULTICAST_IF, IP_MULTICAST_IF2, IP_MULTICAST_LOOP, IP_TOS, SO_BINDADDR, SO_BROADCAST, SO_KEEPALIVE, SO_LINGER, SO_OOBINLINE, SO_RCVBUF, SO_REUSEADDR, SO_REUSEPORT, SO_SNDBUF, SO_TIMEOUT, TCP_NODELAY
-
-
Constructor Summary
Constructors Constructor Description SocketOptions()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
apply(DatagramSocket socket)
Configure the specified socket.void
apply(MulticastSocket socket)
Configure the specified socket.void
apply(ServerSocket socket)
Configure the specified socket.void
apply(Socket socket)
Configure the specified socket.static void
apply(SocketOptions options, DatagramSocket socket)
Apply the specified options to a socket.void
apply(SocketOptions options, MulticastSocket socket)
Apply the specified options to a socket.static void
apply(SocketOptions options, ServerSocket socket)
Apply the specified options to a socket.static void
apply(SocketOptions options, Socket socket)
Apply the specified options to a socket.void
copyOptions(SocketOptions options)
Copy the options in the specified SocketOptions into this SocketOptions.XmlElement
getConfig()
Deprecated.boolean
isConfigured()
Return true iff the XmlSocketOptions have been configured with any options.static SocketOptions
load(XmlElement xml)
Deprecated.void
setConfig(XmlElement xml)
Deprecated.
-
-
-
Field Detail
-
m_xml
protected XmlElement m_xml
The configuration.
-
-
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(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 interfaceXmlConfigurable
- Returns:
- the XML configuration or null
-
setConfig
@Deprecated public void setConfig(XmlElement xml)
Deprecated.Specify the configuration for the object.- Specified by:
setConfig
in interfaceXmlConfigurable
- 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 applysocket
- 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 applysocket
- 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 applysocket
- 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 applysocket
- the socket to configure- Throws:
SocketException
- if an I/O error occurs
-
-