org.clazzes.remoting.client
Class ClientParameters
java.lang.Object
org.clazzes.remoting.SocketParameters
org.clazzes.remoting.client.ClientParameters
- Direct Known Subclasses:
- SSLClientParameters
public class ClientParameters
- extends SocketParameters
An object holding the configuration options for a client.
- Author:
- wglas
Constructor Summary |
ClientParameters()
Construct a client parameters object with the following default parameters:
soTimeout60000
tcpNoDelaytrue
asynchronousfalse
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
socketFactory
protected javax.net.SocketFactory socketFactory
ClientParameters
public ClientParameters()
- Construct a client parameters object with the following default parameters:
soTimeout | 60000 |
tcpNoDelay | true |
asynchronous | false |
tuneSocket
public java.util.Map<java.lang.String,java.lang.Object> tuneSocket(java.net.Socket socket)
throws java.io.IOException
- Description copied from class:
SocketParameters
- Apply user-defined setting to the socket. This may involve
setting of SSL-parameters in derived classes.
- Overrides:
tuneSocket
in class SocketParameters
- 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
getSocketFactory
public javax.net.SocketFactory getSocketFactory()
- Returns:
- The socket factory used by this client. If not set by
setSocketFactory(SocketFactory)
, SocketFactory.getDefault()
is returned.
setSocketFactory
public void setSocketFactory(javax.net.SocketFactory socketFactory)
- Parameters:
socketFactory
- A custom socket factory to set.
getSoTimeout
public int getSoTimeout()
- Returns:
- The socket timeout used when establishing new connections.
- See Also:
Socket.getSoTimeout()
setSoTimeout
public void setSoTimeout(int soTimeout)
- Parameters:
soTimeout
- The socket timeout during the connection establishment phase to set.- See Also:
Socket.setSoTimeout(int)
isAsynchronous
public boolean isAsynchronous()
- Returns:
- Whether the client should use a dedicated thread for reading responses.
If set to
true
, the client may handle broadcast and callback
request at any time and not only when waiting for a response to a remote
invocation. If set to false
, the invocation request is guaranteed
to be deserialized by the same thread that will serialized the invocation
response afterwards.
setAsynchronous
public void setAsynchronous(boolean asynchronous)
- Parameters:
asynchronous
- Whether the client should use a dedicated thread for reading responses.
Copyright © 2010. All Rights Reserved.