|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.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 |
| Fields inherited from interface org.norther.tammi.core.base.MBeanDelegate |
|---|
ARRAY_TYPE, OBJECT_TYPE, PRIMITIVE_TYPE, STRING_TYPE |
| 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.base.Startable |
|---|
isStarted |
| 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 Manageablepostmanaged in class DefaultConnector
public void unmanaged()
throws Exception
Manageable
unmanaged in interface Manageableunmanaged in class DefaultExecutableConnectorException - if the adaptee refused to be unmanaged.public int getConnectionCount()
ConnectorNote that the count is implementation dependent and its accuracy may vary.
getConnectionCount in interface ConnectorgetConnectionCount in interface ExecutableConnectorgetConnectionCount in class DefaultExecutableConnector
public void setAddress(String addr)
throws UnknownHostException
DefaultConnector
setAddress in interface ChannelConnectorsetAddress in class DefaultConnectoraddr - the address of the server.
UnknownHostException - if not found.public int getChannelTimeout()
ChannelConnector
getChannelTimeout in interface ChannelConnectorpublic void setChannelTimeout(int timeout)
ChannelConnector
setChannelTimeout in interface ChannelConnectortimeout - the timeout for channels in msecs.public int getSelectorTimeout()
ChannelConnector
getSelectorTimeout in interface ChannelConnectorpublic void setSelectorTimeout(int timeout)
ChannelConnectorNote 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 ChannelConnectortimeout - the timeout for channels in msecs.public int getSelectorCount()
ChannelConnector
getSelectorCount in interface ChannelConnectorpublic void setSelectorCount(int count)
ChannelConnectorNote 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 ChannelConnectorcount - the number of idle selectors.public boolean keepConnection(Connection con)
Connector
keepConnection in interface ConnectorkeepConnection in class DefaultConnectorcon - the connection.
public void start()
throws Exception
Startable
start in interface Startablestart in class DefaultExecutableConnectorException - if start fails.public void stop()
Startable
stop in interface Startablestop in class DefaultExecutableConnectorpublic void run()
run in interface Runnablerun in class DefaultExecutableConnector
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||