Main Page   Class Hierarchy   Compound List   File List   Compound Members  

SocketListener Class Reference

Collaboration diagram for SocketListener:

Collaboration graph
[legend]
List of all members.

Detailed Description

SocketListener.java defines objects responsible for listening on server socket for incoming connection request.

If there is such request this class initiates procedures assiociated with making new environment for user. Creates de-facto new Remote Console for communicating with user.

Created: Thu Jan 10 15:33:05 2002

Author:
Artur Hefczyc
Version:
Revision
1.1

Definition at line 46 of file SocketListener.java.

Public Methods

 SocketListener ()
 Creates a new SocketListener instance.

void startListening () throws IOException
 Method startListening starts working for this instance with default or earlier set values of server port number and as a daemon or not whatever is set.

void startListening (int port_no, boolean daemon) throws IOException
 Method startListening starts listener working with given parameters of server port number and as daemon or not depends what is set.

void close ()
 Method close closing server socket and stopping listening for incoming connection requests.

void run ()
 Method run performs all actions assiocated with listening on server socket handle new connection requests.

int getPort_no ()
 Gets the value of server socket posrt number.

void setPort_no (int argPort_no)
 Sets the value of server socket posrt number.

ConnectionHandlerIfc getConn_handler ()
 Gets the contained connection handler implementation.

void setConn_handler (ConnectionHandlerIfc argConn_handler)
 Sets the value of conn_handler - reference to instance of ConnectionHandlerIfc.

List getCommand_handlers ()
 Gets the value of command_handlers.

void setCommand_handlers (List argCommand_handlers)
 Sets the value of command_handlers.


Protected Methods

void log (String msg)
 Methodlog is simple logging function which allows to send some messages to log for latter revisiting.


Protected Attributes

int port_no = Constants.DEFAULT_SERVER_PORT
 Variable port_no keeps server port number on which it listening and waiting for incoming connections.

ConnectionHandlerIfc conn_handler = null
 Variable conn_handler contains reference to object responsible for handling new connection requests from users.

List command_handlers = null
 Variable command_handlers contains List of all avilable command handler which are passed to every new created ConnectionServer.

ServerSocket server_socket = null
 Variable server_socket instance of ServerSocket object is used to listening on server socket and wating for incoming new connection requests.

LogIfc log_impl = null
 Variable log_impl contains reference to logging class implementation.

boolean may_run = true
 Variable may_run tells if listening on server socket may be continued if it is false SocketListener finishes his work.


Constructor & Destructor Documentation

SocketListener   [inline]
 

Creates a new SocketListener instance.

This is empty constructor.

Definition at line 87 of file SocketListener.java.


Member Function Documentation

void close   [inline]
 

Method close closing server socket and stopping listening for incoming connection requests.

It does _not_ stops current connections performed to already connected users.

Definition at line 122 of file SocketListener.java.

List getCommand_handlers   [inline]
 

Gets the value of command_handlers.

Returns:
the value of command_handlers

Definition at line 217 of file SocketListener.java.

ConnectionHandlerIfc getConn_handler   [inline]
 

Gets the contained connection handler implementation.

Returns:
the value of conn_handler which is reference to ConnectionHandlerIfc implementation.

Definition at line 198 of file SocketListener.java.

int getPort_no   [inline]
 

Gets the value of server socket posrt number.

Returns:
the value of server socket posrt number.

Definition at line 179 of file SocketListener.java.

void log String    msg [inline, protected]
 

Methodlog is simple logging function which allows to send some messages to log for latter revisiting.

Note that it uses log_impl variable which should keep implementation of local logger.

See also:
SocketListener#log_impl
Parameters:
msg a String value

Definition at line 168 of file SocketListener.java.

void run   [inline]
 

Method run performs all actions assiocated with listening on server socket handle new connection requests.

Definition at line 135 of file SocketListener.java.

void setCommand_handlers List    argCommand_handlers [inline]
 

Sets the value of command_handlers.

Parameters:
argCommand_handlers Value to assign to this.command_handlers

Definition at line 226 of file SocketListener.java.

void setConn_handler ConnectionHandlerIfc    argConn_handler [inline]
 

Sets the value of conn_handler - reference to instance of ConnectionHandlerIfc.

Parameters:
argConn_handler Value to assign to this.conn_handler

Definition at line 208 of file SocketListener.java.

void setPort_no int    argPort_no [inline]
 

Sets the value of server socket posrt number.

Parameters:
argPort_no Value to assign to server socket posrt number.

Definition at line 188 of file SocketListener.java.

void startListening int    port_no,
boolean    daemon
throws IOException [inline]
 

Method startListening starts listener working with given parameters of server port number and as daemon or not depends what is set.

Parameters:
port_no an int value of server socket port number.
daemon a boolean value set if listener should work as a daemon or not.
Exceptions:
IOException if an error occurs during opening server socket for listening.

Definition at line 107 of file SocketListener.java.

void startListening   throws IOException [inline]
 

Method startListening starts working for this instance with default or earlier set values of server port number and as a daemon or not whatever is set.

Exceptions:
IOException if an error occurs during opening server socket for listening.

Definition at line 95 of file SocketListener.java.


Member Data Documentation

List command_handlers = null [protected]
 

Variable command_handlers contains List of all avilable command handler which are passed to every new created ConnectionServer.

Definition at line 64 of file SocketListener.java.

ConnectionHandlerIfc conn_handler = null [protected]
 

Variable conn_handler contains reference to object responsible for handling new connection requests from users.

For more detail please look in ConnectionHandlerIfc docs.

See also:
ConnectionHandlerIfc

Definition at line 59 of file SocketListener.java.

LogIfc log_impl = null [protected]
 

Variable log_impl contains reference to logging class implementation.

It is possible, however not fully implemented, to define by user new log handler and put it to ConnectionServer to allow logging some info to choosen place.

Definition at line 77 of file SocketListener.java.

boolean may_run = true [protected]
 

Variable may_run tells if listening on server socket may be continued if it is false SocketListener finishes his work.

Definition at line 82 of file SocketListener.java.

int port_no = Constants.DEFAULT_SERVER_PORT [protected]
 

Variable port_no keeps server port number on which it listening and waiting for incoming connections.

Definition at line 52 of file SocketListener.java.

ServerSocket server_socket = null [protected]
 

Variable server_socket instance of ServerSocket object is used to listening on server socket and wating for incoming new connection requests.

Definition at line 70 of file SocketListener.java.


The documentation for this class was generated from the following file:
Generated on Thu Dec 19 21:00:48 2002 for WTTools - Remote Console by doxygen1.3-rc2