org.clazzes.remoting
Class SocketParameters

java.lang.Object
  extended by org.clazzes.remoting.SocketParameters
Direct Known Subclasses:
ClientParameters, ServerParameters

public class SocketParameters
extends java.lang.Object

Common parameters for server and client.

Author:
wglas

Field Summary
protected  MarshalerFactory marshalerFactory
           
 
Constructor Summary
SocketParameters()
          Construct a socket parameters object with the following default parameters: tcpNoDelaytrue
 
Method Summary
 MarshalerFactory getMarshalerFactory()
           
 boolean isTcpNoDelay()
           
 void setMarshalerFactory(MarshalerFactory marshalerFactory)
           
 void setTcpNoDelay(boolean tcpNoDelay)
           
 java.util.Map<java.lang.String,java.lang.Object> tuneSocket(java.net.Socket socket)
          Apply user-defined setting to the socket.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

marshalerFactory

protected MarshalerFactory marshalerFactory
Constructor Detail

SocketParameters

public SocketParameters()
Construct a socket parameters object with the following default parameters:
tcpNoDelaytrue

Method Detail

tuneSocket

public java.util.Map<java.lang.String,java.lang.Object> tuneSocket(java.net.Socket socket)
                                                            throws java.io.IOException
Apply user-defined setting to the socket. This may involve setting of SSL-parameters in derived classes.

Parameters:
socket - The socket to prepare for connecting.
Returns:
A map of connection-bound metadata.
Throws:
java.io.IOException - Upon errors from methods of Socket.
See Also:
SocketMetaData, SSLMetaData

isTcpNoDelay

public boolean isTcpNoDelay()
Returns:
Whether to set TCP_NODELAY on generated sockets.
See Also:
Socket.setTcpNoDelay(boolean)

setTcpNoDelay

public void setTcpNoDelay(boolean tcpNoDelay)
Parameters:
tcpNoDelay - Whether to set TCP_NODELAY on generated sockets.
See Also:
Socket.setTcpNoDelay(boolean)

getMarshalerFactory

public MarshalerFactory getMarshalerFactory()
Returns:
The MarshalerFactory to use. If not set by setMarshalerFactory(MarshalerFactory), an instance of DefaultMarshalerFactory is returned.

setMarshalerFactory

public void setMarshalerFactory(MarshalerFactory marshalerFactory)
Parameters:
marshalerFactory - The marshaler factory to set.


Copyright © 2010. All Rights Reserved.