|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.norther.tammi.core.base.Adaptee org.norther.tammi.spray.connector.DefaultConnector org.norther.tammi.spray.connector.DefaultExecutableConnector org.norther.tammi.spray.connector.DefaultTCPConnector org.norther.tammi.spray.connector.DefaultChannelConnector
public class DefaultChannelConnector
A default implementation of ChannelConnector.
Field Summary |
---|
Fields inherited from class org.norther.tammi.spray.connector.DefaultConnector |
---|
LOCALHOST |
Fields inherited from class org.norther.tammi.core.base.Adaptee |
---|
ADAPTEE_NOTIF_DESCRIPTION, ADAPTEE_NOTIFICATIONS |
Constructor Summary | |
---|---|
DefaultChannelConnector()
Constructs a new connector. |
|
DefaultChannelConnector(InetAddress addr)
Constructs a connector with a host address. |
Method Summary | |
---|---|
int |
getChannelTimeout()
Gets the timeout to wait for an asynchronous I/O operation from a channel. |
int |
getConnectionCount()
Gets a snapshot of the number of active and idle connections. |
int |
getSelectorCount()
Gets the number of selectors to apply. |
int |
getSelectorTimeout()
Gets the timeout to wait for selected channels to be ready for I/O. |
boolean |
keepConnection(Connection con)
Keeps the specified connection alive on idle after processing the corresponding request if applicable. |
void |
postmanaged()
This method is called when the implementing adaptee has been managed either during post-registration of the corresponding adapter MBean or just after it is explicitly added to the adapter MBean during run-time. |
void |
run()
|
void |
setAddress(String addr)
Sets the address of the server of the connection. |
void |
setChannelTimeout(int timeout)
Sets the timeout to wait for an asynchronous I/O operation. |
void |
setSelectorCount(int count)
Sets the number of selectors to apply. |
void |
setSelectorTimeout(int timeout)
Sets the timeout to wait for selected channels to be ready for I/O. |
void |
start()
Starts the MBean. |
void |
stop()
Stops the MBean. |
void |
unmanaged()
This method is called when the implementing adaptee is unmanaged either during pre-deregistration of the corresponding adapter MBean or just before it is explicitly removed from the adapter MBean during run-time. |
Methods inherited from class org.norther.tammi.spray.connector.DefaultTCPConnector |
---|
getReceiveBufferSize, getSendBufferSize, getServerBufferSize, getSoLinger, getSoTimeout, isTcpNoDelay, setReceiveBufferSize, setSendBufferSize, setServerBufferSize, setSoLinger, setSoTimeout, setTcpNoDelay |
Methods inherited from class org.norther.tammi.spray.connector.DefaultExecutableConnector |
---|
execute, getExecutorMBean, getExecutorName, getRequestExecutorName, isStarted, premanaged, setExecutorName, setRequestExecutorName |
Methods inherited from class org.norther.tammi.spray.connector.DefaultConnector |
---|
getAddress, getConnectionTimeout, getFilterMBean, getFilterName, getInetAddress, getKeyAlias, getLoggerMBean, getLoggerName, getMaxIdleConnections, getName, getPort, getProvider, getRedirectPort, getRequestTimeout, getTimeoutMBean, isKeepConnection, isLoggingDisabled, isSecure, setConnectionTimeout, setFilterName, setInetAddress, setKeyAlias, setKeyPassword, setLoggerName, setLoggingDisabled, setMaxIdleConnections, setPort, setProvider, setRedirectPort, setRequestTimeout, setSecure |
Methods inherited from class org.norther.tammi.core.base.Adaptee |
---|
addAdaptee, addNotificationListener, getAttributeSupport, getBroker, getCanonicalName, getDomain, getFactory, getLoader, getLog, getLog, getMBean, getMBeanServer, getNotificationInfo, getObjectName, getRegistrationTime, getSequenceNumber, hasListeners, isRegistered, removeNotificationListener, removeNotificationListener, sendNotification, sendNotification, sendNotification, sendNotification, unregister |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.norther.tammi.spray.connector.TCPConnector |
---|
getReceiveBufferSize, getSendBufferSize, getServerBufferSize, getSoLinger, getSoTimeout, isTcpNoDelay, setReceiveBufferSize, setSendBufferSize, setServerBufferSize, setSoLinger, setSoTimeout, setTcpNoDelay |
Methods inherited from interface org.norther.tammi.spray.connector.ExecutableConnector |
---|
getRequestExecutorName, setRequestExecutorName |
Methods inherited from interface org.norther.tammi.spray.connector.Connector |
---|
getAddress, getConnectionTimeout, getFilterName, getKeyAlias, getLoggerName, getMaxIdleConnections, getName, getPort, getProvider, getRedirectPort, getRequestTimeout, isKeepConnection, isLoggingDisabled, isSecure, setConnectionTimeout, setFilterName, setKeyAlias, setKeyPassword, setLoggerName, setLoggingDisabled, setMaxIdleConnections, setPort, setProvider, setRedirectPort, setRequestTimeout, setSecure |
Methods inherited from interface org.norther.tammi.core.thread.Executable |
---|
getExecutorName, setExecutorName |
Methods inherited from interface org.norther.tammi.core.base.Startable |
---|
isStarted |
Constructor Detail |
---|
public DefaultChannelConnector()
public DefaultChannelConnector(InetAddress addr)
addr
- the host address.Method Detail |
---|
public void postmanaged()
Manageable
postmanaged
in interface Manageable
postmanaged
in class DefaultConnector
public void unmanaged() throws Exception
Manageable
unmanaged
in interface Manageable
unmanaged
in class DefaultExecutableConnector
Exception
- if the adaptee refused to be unmanaged.public int getConnectionCount()
Connector
Note that the count is implementation dependent and its accuracy may vary.
getConnectionCount
in interface Connector
getConnectionCount
in interface ExecutableConnector
getConnectionCount
in class DefaultExecutableConnector
public void setAddress(String addr) throws UnknownHostException
DefaultConnector
setAddress
in interface ChannelConnector
setAddress
in class DefaultConnector
addr
- the address of the server.
UnknownHostException
- if not found.public int getChannelTimeout()
ChannelConnector
getChannelTimeout
in interface ChannelConnector
public void setChannelTimeout(int timeout)
ChannelConnector
setChannelTimeout
in interface ChannelConnector
timeout
- the timeout for channels in msecs.public int getSelectorTimeout()
ChannelConnector
getSelectorTimeout
in interface ChannelConnector
public void setSelectorTimeout(int timeout)
ChannelConnector
Note that selector threads in Linux seem to suspend for exactly 100 seconds during longer intervals without selections if the selector timeout is not specified.
setSelectorTimeout
in interface ChannelConnector
timeout
- the timeout for channels in msecs.public int getSelectorCount()
ChannelConnector
getSelectorCount
in interface ChannelConnector
public void setSelectorCount(int count)
ChannelConnector
Note that the per-thread model doesn't work for SSL connections.
Note that this value cannot be changed while the connector is running.
setSelectorCount
in interface ChannelConnector
count
- the number of idle selectors.public boolean keepConnection(Connection con)
Connector
keepConnection
in interface Connector
keepConnection
in class DefaultConnector
con
- the connection.
public void start() throws Exception
Startable
start
in interface Startable
start
in class DefaultExecutableConnector
Exception
- if start fails.public void stop()
Startable
stop
in interface Startable
stop
in class DefaultExecutableConnector
public void run()
run
in interface Runnable
run
in class DefaultExecutableConnector
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |