|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectkaos.core.service.transport.mockets.MocketCommServer
public class MocketCommServer
CommServer is a simple Object passing class that sets up a simple server that can receive Objects. It can be initialized with or port or just find an open port
| Nested Class Summary | |
|---|---|
class |
MocketCommServer.ClientHandler
|
class |
MocketCommServer.ServerThread
Listens for new connections and add them to the list of connections to handle. |
| Field Summary | |
|---|---|
protected java.util.Vector |
_clientHandlers
|
protected java.lang.String |
_host
|
protected TCPMessageReceiver |
_messageReceiver
|
protected int |
_port
|
protected ServerMocket |
_serverMocket
|
protected java.util.Vector |
_vObjects
|
| Constructor Summary | |
|---|---|
MocketCommServer()
testing constructor |
|
MocketCommServer(TCPMessageReceiver mr)
Normal constructor |
|
| Method Summary | |
|---|---|
void |
close()
tries to close server socket |
java.lang.String |
getHost()
returns the hostname of this server. |
java.lang.Object |
getNextObject()
getNextObject |
java.util.Vector |
getNextObjects()
Checks all incoming input streams for new objects. |
int |
getPort()
returns the port number of this server. |
void |
init()
Tries to start a socketserver on any available port. |
void |
init(int iPort)
Tries to start a socketserver on the specified port. |
static void |
main(java.lang.String[] args)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ServerMocket _serverMocket
protected int _port
protected java.lang.String _host
protected java.util.Vector _clientHandlers
protected java.util.Vector _vObjects
protected TCPMessageReceiver _messageReceiver
| Constructor Detail |
|---|
public MocketCommServer(TCPMessageReceiver mr)
public MocketCommServer()
| Method Detail |
|---|
public void init()
throws TransportFailure
init in interface CommServerTransportFailure
public void init(int iPort)
throws TransportFailure
init in interface CommServerport -
TransportFailurepublic void close()
close in interface CommServerpublic java.lang.String getHost()
getHost in interface CommServerpublic int getPort()
getPort in interface CommServerpublic java.lang.Object getNextObject()
public java.util.Vector getNextObjects()
public static void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||