|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ls.lars.communication.SocketListener
manages incoming client requests via sockets
Field Summary | |
protected Map |
connectionParameters
contains the connection parameters for this Listener, e.g the compression settings |
protected Thread |
listenerThread
reference to this thread (needed for proper thread termination) |
protected ILogger |
logger
the reference to the owning agent's log file (initally set to SystemLogger.getLogger() ) |
protected int |
port
port number of the server socket |
static int |
socketListenerThreadId
thread id for socket listeners |
Constructor Summary | |
SocketListener(int port)
Constructor, that sets the agent and port. |
Method Summary | |
protected com.ls.lars.communication.SocketMessenger |
createClientSocketMessenger(Socket clientSocket)
creates a client socket messenger (here: a SocketMessenger) |
int |
nextSocketListenerId()
returns the next unique (within this Java Virtual Machine) id to be used in a socket listener name |
void |
run()
Creates the server socket. |
void |
setConnectionParameters(Map connectionParameters)
Sets the connection parameters e.g. compression settings, secure settings, ... |
void |
setLog(ILogger log)
Sets the ILogger for the listener. |
void |
start()
starts the listener thread and sets the thread name |
void |
stop()
stops listener thread in a safe way |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static int socketListenerThreadId
protected Thread listenerThread
protected ILogger logger
SystemLogger.getLogger()
)protected int port
protected Map connectionParameters
Constructor Detail |
public SocketListener(int port)
listenerAgent
- agent which belongs to this listenerport
- port number on which the listener should listenMethod Detail |
public void setLog(ILogger log)
log
- reference to the ILogger of the owning agentpublic void start() throws ProgrammingException
ProgrammingException
- If this listener was already started beforepublic void stop()
public void run()
run
in interface Runnable
public void setConnectionParameters(Map connectionParameters)
connectionParameters
- contains any Map with any parametersprotected com.ls.lars.communication.SocketMessenger createClientSocketMessenger(Socket clientSocket)
clientSocket
- socket by that the client is connected to the serverpublic int nextSocketListenerId()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |