|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ikrs.yuccasrv.ConnectionHandler ikrs.yuccasrv.TCPAdapter
public abstract class TCPAdapter
Constructor Summary | |
---|---|
TCPAdapter()
|
Method Summary | |
---|---|
abstract void |
finalize(long time,
java.util.concurrent.TimeUnit unit)
This method will be called if the SocketManager is going to terminate. |
abstract void |
init(Environment<java.lang.String,BasicType> additionalSettings,
Environment<java.lang.String,BasicType> optionalReturnValues)
This method will be called after the connection handler was instantiated (usually using the Class.newInstance() method). |
abstract void |
serverAcceptedTCPConnection(BindManager source,
java.util.UUID socketID,
java.net.Socket sock,
ConnectionUserID<ConnectionUserID> userID)
|
void |
serverAcceptedUDPConnection(BindManager source,
java.util.UUID socketID,
java.net.DatagramSocket sock,
ConnectionUserID<ConnectionUserID> userID)
This method is not meant to be called as this is a _TCP_ handler. |
void |
serverClosed(BindManager source,
java.util.UUID socketID)
This method does nothing except forwarding the INFO to the global logger instance via LogManager.getLogManager().getLogger( Constants.DEFAULT_LOGGER_NAME ).log( ... |
void |
serverCreated(BindManager source,
java.util.UUID socketID)
This method does nothing except forwarding an INFO/WARNING to the global logger instance via LogManager.getLogManager().getLogger( Constants.DEFAULT_LOGGER_NAME ).log( ... |
void |
serverError(BindManager source,
java.util.UUID socketID,
java.lang.Exception e,
boolean isTraumatic)
This method simply logs a SEVERE error to the global Logger via LogManager.getLogManager().getLogger( Constants.DEFAULT_LOGGER_NAME ).log( ... |
Methods inherited from class ikrs.yuccasrv.ConnectionHandler |
---|
getUUID |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TCPAdapter()
Method Detail |
---|
public abstract void init(Environment<java.lang.String,BasicType> additionalSettings, Environment<java.lang.String,BasicType> optionalReturnValues) throws java.lang.InstantiationException
init
in class ConnectionHandler
additionalSettings
- An environment containing additional initialization params. Might be null or empty.optionalReturnValues
- An environment the method may use to store (optional) return values in. May be null.
java.lang.InstantiationException
public void serverCreated(BindManager source, java.util.UUID socketID)
serverCreated
in interface BindListener
serverCreated
in class ConnectionHandler
source
- The BindManager that reports the event.socketID
- A unique ID to identify the created socket by the use of
BindManager.getServer*( socketID ).public void serverError(BindManager source, java.util.UUID socketID, java.lang.Exception e, boolean isTraumatic)
serverError
in interface BindListener
serverError
in class ConnectionHandler
source
- The BindManager that reports the event.socketID
- The server's unique ID.e
- The reported exception.isTraumatic
- This flag tell if the server socket can still
be used or if it's (probably) broken and should be
restarted. In the second case the BindManager will
automatically close and remove the socket to free
the resources.public abstract void serverAcceptedTCPConnection(BindManager source, java.util.UUID socketID, java.net.Socket sock, ConnectionUserID<ConnectionUserID> userID)
serverAcceptedTCPConnection
in interface BindListener
serverAcceptedTCPConnection
in class ConnectionHandler
source
- The BindManager that reports the event.sockedID
- The server socket's unique ID.sock
- The accepted connection socket.public final void serverAcceptedUDPConnection(BindManager source, java.util.UUID socketID, java.net.DatagramSocket sock, ConnectionUserID<ConnectionUserID> userID)
serverAcceptedUDPConnection
in interface BindListener
serverAcceptedUDPConnection
in class ConnectionHandler
source
- The BindManager that reports the event.sockedID
- The server socket's unique ID.sock
- The accepted connection socket.public void serverClosed(BindManager source, java.util.UUID socketID)
serverClosed
in interface BindListener
serverClosed
in class ConnectionHandler
source
- The BindManager that reports the event.sockedID
- The server socket's unique ID.public abstract void finalize(long time, java.util.concurrent.TimeUnit unit)
finalize
in interface BindListener
finalize
in class ConnectionHandler
time
- The time value all dependent child threads have to terminate in.unit
- The time unit.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |