|
Jumpi v1.2.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jumpi.impl.connector.tcp.TcpConnectionAcceptor
Establishes a ServerSocket on the configured port, continuously accepting Sockets and notifying the TcpConnector of the accepted Sockets until shutdown.
Constructor Summary | |
TcpConnectionAcceptor()
Creates a new TcpConnectionAcceptor object. |
Method Summary | |
void |
configure(java.lang.String name,
Properties props)
Configure the TcpConnectionAcceptor. |
java.net.InetAddress |
getAddress()
Return the InetAddress. |
java.lang.String |
getName()
Get the fully qualified name of the instance. |
int |
getPort()
Return the ServerSocket's port. |
java.lang.String |
getTaskId()
A unique name for the task in the VM. |
boolean |
isLongRunning()
Returns true always since the ServerSocket acceptor works continuously and requires a dedicated Task. |
boolean |
isSchedulable()
The acceptor is schedulable as long as the ServerSocket exists. |
void |
manage(Component root,
Component parent,
java.lang.String operation,
java.util.Hashtable parameters)
Perform a recursive management operation through the Jumpi component tree, using the parameters provided. |
void |
run()
Accept a Socket from the ServerSocket and notify the TcpConnector. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TcpConnectionAcceptor()
Method Detail |
public java.net.InetAddress getAddress()
public int getPort()
public java.lang.String getName()
getName
in interface Configurable
configure(java.lang.String, org.jumpi.spi.Properties)
public void configure(java.lang.String name, Properties props) throws java.lang.Exception
The following configuration attributes are defined:
timeout - integer[1000..MAX-INT] - optional[30000].
The server socket accept timeout in milliseconds. Maximum time interval that the accepting thread will be stuck in the socket's accept call if there are no new connection attempts.
port - integer[1000..MAX-INT] - optional[8888].
The server socket port.
backlog - integer[1000..MAX-INT] - optional[10].
The server socket backlog. The number of unaccepted connections, pending aception, which can be buffered by the operating system.
address - string - optional.
The local address to use if this is to be different from the localhost address. Used to determine the network card to use on multi-homed hosts.
configure
in interface Configurable
name
- the fully qualified instance name.props
- the read-only properties to configure the instance with.
java.lang.Exception
- when configuration is unsuccessful.
java.lang.IllegalArgumentException
- if name or properties are missing.public void manage(Component root, Component parent, java.lang.String operation, java.util.Hashtable parameters) throws java.lang.Exception
The following management actions are handled:
manage
in interface Manageable
root
- the Jumpi instance at the root of the component tree.parent
- the immediate parent of the component.operation
- the operation.parameters
- the operation parameters.
java.lang.Exception
- if any failure to perform management occurs.
java.lang.IllegalArgumentException
- when parameters are missing.public java.lang.String getTaskId()
getTaskId
in interface Task
public boolean isSchedulable()
isSchedulable
in interface Task
manage(org.jumpi.spi.Component, org.jumpi.spi.Component, java.lang.String, java.util.Hashtable)
public boolean isLongRunning()
isLongRunning
in interface Task
public void run()
run
in interface java.lang.Runnable
|
Jumpi v1.2.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |