GigaSpaces XAP 7.0 API

com.gigaspaces.config.lrmi.nio
Class NIOConfiguration

java.lang.Object
  extended by com.gigaspaces.config.lrmi.AbstractTransportConfigration
      extended by com.gigaspaces.config.lrmi.nio.NIOConfiguration
All Implemented Interfaces:
com.gigaspaces.config.IConfiguration, com.gigaspaces.config.lrmi.ITransportConfig, Externalizable, Serializable, Cloneable

public class NIOConfiguration
extends com.gigaspaces.config.lrmi.AbstractTransportConfigration
implements Cloneable, Externalizable

This class provides configuration object of NIO communication transport protocol.

Since:
5.2
Author:
Igor Goldenberg
See Also:
GenericExporter, Serialized Form

Field Summary
 
Fields inherited from class com.gigaspaces.config.lrmi.AbstractTransportConfigration
_maxThreads, _minThreads, _protocolAdaptorClass, _threadsQueueSize, DEFAULT_THREAD_QUEUE_SIZE
 
Constructor Summary
NIOConfiguration()
          Should not be used, only for externalizable.
NIOConfiguration(int minThreads, int maxThreads, int maxConnPool, boolean isMultiplex, String bindHostName, String bindPort)
          Deprecated. use NIOConfiguration(int, int, int, String, String) instead
NIOConfiguration(int minThreads, int maxThreads, int maxConnPool, boolean isMultiplex, String bindHostName, String bindPort, int threadsQueueSize, int slowConsumerThroughput, int slowConsumerLatency, int slowConsumerRetries)
          Deprecated. use NIOConfiguration( int, int, int, String, String, int, int, int, int)
NIOConfiguration(int minThreads, int maxThreads, int maxConnPool, boolean isMultiplex, String bindHostName, String bindPort, int threadsQueueSize, int slowConsumerThroughput, int slowConsumerLatency, int slowConsumerRetries, int readSelectorThreads, String watchdogRequestTimeout, String watchdogListeningTimeout, String watchdogIdleConnectionTimeout, long threadPoolIdleTimeout, String socketConnectTimeout)
          Deprecated. use NIOConfiguration( int, int, int, String, String, int, int, int, int, int, String, String, String, long, String) instead
NIOConfiguration(int minThreads, int maxThreads, int maxConnPool, boolean isMultiplex, String bindHostName, String bindPort, int readSelectorThreads, String watchdogRequestTimeout, String watchdogListeningTimeout, String watchdogIdleConnectionTimeout, long threadPoolIdleTimeout, String socketConnectTimeout)
          Deprecated. use NIOConfiguration( int, int, int, String, String, int, String, String, String, long, String)
NIOConfiguration(int minThreads, int maxThreads, int maxConnPool, String bindHostName, String bindPort)
           
NIOConfiguration(int minThreads, int maxThreads, int maxConnPool, String bindHostName, String bindPort, int threadsQueueSize, int slowConsumerThroughput, int slowConsumerLatency, int slowConsumerRetries)
           
NIOConfiguration(int minThreads, int maxThreads, int maxConnPool, String bindHostName, String bindPort, int threadsQueueSize, int slowConsumerThroughput, int slowConsumerLatency, int slowConsumerRetries, int readSelectorThreads, String watchdogRequestTimeout, String watchdogListeningTimeout, String watchdogIdleConnectionTimeout, long threadPoolIdleTimeout, String socketConnectTimeout)
          Constructor.
NIOConfiguration(int minThreads, int maxThreads, int maxConnPool, String bindHostName, String bindPort, int readSelectorThreads, String watchdogRequestTimeout, String watchdogListeningTimeout, String watchdogIdleConnectionTimeout, long threadPoolIdleTimeout, String socketConnectTimeout)
          The most commonly used constructor through the services.config configuration file.
 
Method Summary
static NIOConfiguration create()
          Creates a new instance of NIO configuration based on system properties.
 com.gigaspaces.config.lrmi.ITransportBindDetails[] getBindDetails()
           
 String getBindHostName()
           
 String getBindPort()
           
 int getConnectionPoolSize()
           
 int getMaxConnPool()
           
 String getProtocolName()
           
 int getReadSelectorThreads()
           
 int getSlowConsumerLatency()
           
 int getSlowConsumerRetries()
           
 int getSlowConsumerThroughput()
           
 long getSocketConnectTimeout()
           
 long getThreadPoolIdleTimeout()
           
 long getWatchdogIdleConnectionTimeout()
           
 long getWatchdogListeningTimeout()
           
 long getWatchdogRequestTimeout()
           
 boolean isBlockingConnection()
           
 void readExternal(ObjectInput in)
           
 void setBindHost(String bindHostName)
           
 void setBindPort(String bindPort)
           
 void setBlockingConnection(boolean blockingConnection)
           
 void setMaxConnPool(int maxConnPool)
           
 void setReadSelectorThreads(int selectorThreads)
           
 void setSlowConsumerLatency(int slowConsumerLatency)
           
 void setSlowConsumerRetries(int slowConsumerRetries)
           
 void setSlowConsumerThroughput(int slowConsumerThroughput)
           
 void setSocketConnectTimeout(long socketConnectTimeout)
           
 void setThreadPoolIdleTimeout(long threadPoolIdleTimeout)
           
 void setWatchdogIdleConnectionTimeout(long idleConnectionTimeout)
           
 void setWatchdogListeningTimeout(long listeningTimeout)
           
 void setWatchdogRequestTimeout(long requestTimeout)
           
 String toString()
           
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class com.gigaspaces.config.lrmi.AbstractTransportConfigration
clone, getMaxThreads, getMinThreads, getProtocolAdaptorClass, getThreadsQueueSize, setMaxThreads, setMinThreads, setThreadsQueueSize
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NIOConfiguration

@Deprecated
public NIOConfiguration(int minThreads,
                                   int maxThreads,
                                   int maxConnPool,
                                   boolean isMultiplex,
                                   String bindHostName,
                                   String bindPort)
Deprecated. use NIOConfiguration(int, int, int, String, String) instead


NIOConfiguration

public NIOConfiguration(int minThreads,
                        int maxThreads,
                        int maxConnPool,
                        String bindHostName,
                        String bindPort)

NIOConfiguration

@Deprecated
public NIOConfiguration(int minThreads,
                                   int maxThreads,
                                   int maxConnPool,
                                   boolean isMultiplex,
                                   String bindHostName,
                                   String bindPort,
                                   int readSelectorThreads,
                                   String watchdogRequestTimeout,
                                   String watchdogListeningTimeout,
                                   String watchdogIdleConnectionTimeout,
                                   long threadPoolIdleTimeout,
                                   String socketConnectTimeout)
Deprecated. use NIOConfiguration( int, int, int, String, String, int, String, String, String, long, String)

The most commonly used constructor through the services.config configuration file.


NIOConfiguration

public NIOConfiguration(int minThreads,
                        int maxThreads,
                        int maxConnPool,
                        String bindHostName,
                        String bindPort,
                        int readSelectorThreads,
                        String watchdogRequestTimeout,
                        String watchdogListeningTimeout,
                        String watchdogIdleConnectionTimeout,
                        long threadPoolIdleTimeout,
                        String socketConnectTimeout)
The most commonly used constructor through the services.config configuration file.


NIOConfiguration

@Deprecated
public NIOConfiguration(int minThreads,
                                   int maxThreads,
                                   int maxConnPool,
                                   boolean isMultiplex,
                                   String bindHostName,
                                   String bindPort,
                                   int threadsQueueSize,
                                   int slowConsumerThroughput,
                                   int slowConsumerLatency,
                                   int slowConsumerRetries,
                                   int readSelectorThreads,
                                   String watchdogRequestTimeout,
                                   String watchdogListeningTimeout,
                                   String watchdogIdleConnectionTimeout,
                                   long threadPoolIdleTimeout,
                                   String socketConnectTimeout)
Deprecated. use NIOConfiguration( int, int, int, String, String, int, int, int, int, int, String, String, String, long, String) instead


NIOConfiguration

public NIOConfiguration(int minThreads,
                        int maxThreads,
                        int maxConnPool,
                        String bindHostName,
                        String bindPort,
                        int threadsQueueSize,
                        int slowConsumerThroughput,
                        int slowConsumerLatency,
                        int slowConsumerRetries,
                        int readSelectorThreads,
                        String watchdogRequestTimeout,
                        String watchdogListeningTimeout,
                        String watchdogIdleConnectionTimeout,
                        long threadPoolIdleTimeout,
                        String socketConnectTimeout)
Constructor.

Parameters:
minThreads - Maintains thread pool in Client and Server that manage incoming remote requests. The thread pool size is increased each time with one additional thread and shrinks when existing threads are not used for 5 minutes. This parameter specifies the minimum size of this thread pool.
maxThreads - This parameter specifies the maximum size of this thread pool. You should make sure the pool max size will accommodate the maximum number of concurrent requests to the serverEndPoint. When the pool is exhausted and all threads are consumed to process incoming requests, additional requests will be blocked until existing requested processing will be completed.
maxConnPool - Client connection pool maximum size to server. Starts with 1 connection.
bindHostName - The host address the server socket is bound to. Relevant for the multi-NIC environment. If null resolves to the localhost IP address.
bindPort - the bind port used for incoming client requests. The server port is set by default to 0, which means next free port. This means that whenever the serverEndPoint is launched it allocates one of the available ports. Define a specific port value to enforce a specific port for the serverEndPoint.
threadsQueueSize - Maintains thread pool queue size in Client and Server that manage incoming remote requests. Once the queue sized is reached the incoming messages are blocked.
slowConsumerThroughput - a client that its network throughput doesn't reach this limit will be suspected as slow.
slowConsumerLatency - a client that is suspected as slow that will not be recover after this time will be disconnected.
slowConsumerRetries - the number of retries to recover a client that is suspected as slow.
readSelectorThreads - LRMI number of read selector threads default = 1.
watchdogRequestTimeout - LRMI Watchdog request timeout.
watchdogListeningTimeout - LRMI Watchdog Listening timeout.
watchdogIdleConnectionTimeout -
threadPoolIdleTimeout - LRMI ThreadPool idle timeout
socketConnectTimeout - The timeout on lrmi socket connect.
See Also:
SystemProperties.LRMI_READ_SELECTOR_THREADS, SystemProperties.WATCHDOG_REQUEST_TIMEOUT_DEFAULT, SystemProperties.WATCHDOG_LISTENING_TIMEOUT_DEFAULT

NIOConfiguration

@Deprecated
public NIOConfiguration(int minThreads,
                                   int maxThreads,
                                   int maxConnPool,
                                   boolean isMultiplex,
                                   String bindHostName,
                                   String bindPort,
                                   int threadsQueueSize,
                                   int slowConsumerThroughput,
                                   int slowConsumerLatency,
                                   int slowConsumerRetries)
Deprecated. use NIOConfiguration( int, int, int, String, String, int, int, int, int)


NIOConfiguration

public NIOConfiguration(int minThreads,
                        int maxThreads,
                        int maxConnPool,
                        String bindHostName,
                        String bindPort,
                        int threadsQueueSize,
                        int slowConsumerThroughput,
                        int slowConsumerLatency,
                        int slowConsumerRetries)

NIOConfiguration

public NIOConfiguration()
Should not be used, only for externalizable.

Method Detail

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException

create

public static NIOConfiguration create()
                               throws UnknownHostException
Creates a new instance of NIO configuration based on system properties.

Throws:
UnknownHostException

getConnectionPoolSize

public int getConnectionPoolSize()
Specified by:
getConnectionPoolSize in interface com.gigaspaces.config.lrmi.ITransportConfig

setMaxConnPool

public void setMaxConnPool(int maxConnPool)

setBindHost

public void setBindHost(String bindHostName)

setBindPort

public void setBindPort(String bindPort)

setBlockingConnection

public void setBlockingConnection(boolean blockingConnection)

getMaxConnPool

public int getMaxConnPool()

getBindPort

public String getBindPort()

getBindHostName

public String getBindHostName()

getProtocolName

public final String getProtocolName()
Specified by:
getProtocolName in interface com.gigaspaces.config.lrmi.ITransportConfig

isBlockingConnection

public boolean isBlockingConnection()
Specified by:
isBlockingConnection in interface com.gigaspaces.config.lrmi.ITransportConfig

getSlowConsumerLatency

public int getSlowConsumerLatency()
Specified by:
getSlowConsumerLatency in interface com.gigaspaces.config.lrmi.ITransportConfig

setSlowConsumerLatency

public void setSlowConsumerLatency(int slowConsumerLatency)

getSlowConsumerRetries

public int getSlowConsumerRetries()
Specified by:
getSlowConsumerRetries in interface com.gigaspaces.config.lrmi.ITransportConfig

setSlowConsumerRetries

public void setSlowConsumerRetries(int slowConsumerRetries)

getSlowConsumerThroughput

public int getSlowConsumerThroughput()
Specified by:
getSlowConsumerThroughput in interface com.gigaspaces.config.lrmi.ITransportConfig

setSlowConsumerThroughput

public void setSlowConsumerThroughput(int slowConsumerThroughput)

getReadSelectorThreads

public int getReadSelectorThreads()
Specified by:
getReadSelectorThreads in interface com.gigaspaces.config.lrmi.ITransportConfig
Returns:
Returns the _readSelectorThreads.

setReadSelectorThreads

public void setReadSelectorThreads(int selectorThreads)
Specified by:
setReadSelectorThreads in interface com.gigaspaces.config.lrmi.ITransportConfig
Parameters:
selectorThreads - The _readSelectorThreads to set.

getWatchdogRequestTimeout

public long getWatchdogRequestTimeout()
Specified by:
getWatchdogRequestTimeout in interface com.gigaspaces.config.lrmi.ITransportConfig
Returns:
Returns the _watchdogRequestTimeout.

setWatchdogRequestTimeout

public void setWatchdogRequestTimeout(long requestTimeout)
Specified by:
setWatchdogRequestTimeout in interface com.gigaspaces.config.lrmi.ITransportConfig
Parameters:
requestTimeout - The _watchdogRequestTimeout to set.

getWatchdogListeningTimeout

public long getWatchdogListeningTimeout()
Specified by:
getWatchdogListeningTimeout in interface com.gigaspaces.config.lrmi.ITransportConfig
Returns:
Returns the _watchdogListeningTimeout.

setWatchdogListeningTimeout

public void setWatchdogListeningTimeout(long listeningTimeout)
Specified by:
setWatchdogListeningTimeout in interface com.gigaspaces.config.lrmi.ITransportConfig
Parameters:
listeningTimeout - The _watchdogListeningTimeout to set.

getWatchdogIdleConnectionTimeout

public long getWatchdogIdleConnectionTimeout()
Specified by:
getWatchdogIdleConnectionTimeout in interface com.gigaspaces.config.lrmi.ITransportConfig
Returns:
Returns the _watchdogIdleConnectionTimeout.

setWatchdogIdleConnectionTimeout

public void setWatchdogIdleConnectionTimeout(long idleConnectionTimeout)
Specified by:
setWatchdogIdleConnectionTimeout in interface com.gigaspaces.config.lrmi.ITransportConfig
Parameters:
idleConnectionTimeout - The _watchdogIdleConnectionTimeout to set.

getThreadPoolIdleTimeout

public long getThreadPoolIdleTimeout()
Specified by:
getThreadPoolIdleTimeout in interface com.gigaspaces.config.lrmi.ITransportConfig

setThreadPoolIdleTimeout

public void setThreadPoolIdleTimeout(long threadPoolIdleTimeout)
Specified by:
setThreadPoolIdleTimeout in interface com.gigaspaces.config.lrmi.ITransportConfig

getSocketConnectTimeout

public long getSocketConnectTimeout()
Specified by:
getSocketConnectTimeout in interface com.gigaspaces.config.lrmi.ITransportConfig

setSocketConnectTimeout

public void setSocketConnectTimeout(long socketConnectTimeout)
Specified by:
setSocketConnectTimeout in interface com.gigaspaces.config.lrmi.ITransportConfig

toString

public String toString()
Overrides:
toString in class Object

getBindDetails

public com.gigaspaces.config.lrmi.ITransportBindDetails[] getBindDetails()

GigaSpaces XAP 7.0 API

Copyright © GigaSpaces.