|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ikrs.yuccasrv.socketmngr.BindManager
public class BindManager
Ths BindManager is the central entity that manages server sockets and their bindings to the system. It additionally accepts incoming connections and passes them to the installed BindListeners. If a server/socket was closed by any reason the manager frees bound resources and removes the socket from the inner table.
Constructor Summary | |
---|---|
BindManager()
|
|
BindManager(CustomLogger logger)
|
Method Summary | |
---|---|
boolean |
addBindListener(BindListener l)
This method adds a new BindListener to this BindManager. |
java.util.UUID |
bind(java.net.InetAddress address,
int port,
Environment<java.lang.String,BasicType> bindSettings)
This method can be used to bind new server sockets to the system. |
void |
closeAllServerSockets()
|
void |
finalize(long time,
java.util.concurrent.TimeUnit unit)
|
protected CustomLogger |
getLogger()
|
java.util.Map<java.lang.String,BasicType> |
getServerSettings(java.util.UUID socketID)
|
java.lang.String |
getStatusString()
|
void |
incomingTCPConnection(ServerSocketThread t,
java.net.Socket s)
This method is called if a server socket successfully accepted an incoming TCP connection. |
void |
incomingUDPConnection(ServerSocketThread t,
java.net.DatagramSocket s)
This method is called if a server socket successfully accepted an incoming UDP 'connection'. |
void |
release(java.util.UUID socketID)
|
boolean |
removeBindListener(BindListener l)
This method removes a BindListener from this BindManager. |
void |
run()
|
void |
serverSocketClosed(ServerSocketThread t)
This method is called if a socket was closed by user/system request. |
void |
serverSocketException(ServerSocketThread t,
java.nio.channels.IllegalBlockingModeException e)
This method is called if a socket caused a IllegalBlockingModeException by any reason. |
void |
serverSocketException(ServerSocketThread t,
java.io.IOException e)
This method is called if a socket caused an IOException by any reason. |
void |
serverSocketException(ServerSocketThread t,
java.lang.SecurityException e)
This method is called if a socket caused a SecurityException by any reason. |
void |
serverSocketException(ServerSocketThread t,
java.net.SocketTimeoutException e)
This method is called if a socket caused a SocketTimeoutException. |
void |
setLogger(CustomLogger logger)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BindManager()
public BindManager(CustomLogger logger)
Method Detail |
---|
public void setLogger(CustomLogger logger) throws java.lang.NullPointerException
java.lang.NullPointerException
protected CustomLogger getLogger()
public boolean addBindListener(BindListener l) throws java.lang.NullPointerException
l
- The bind listener to be added (must not be null).
java.lang.NullPointerException
public boolean removeBindListener(BindListener l)
l
- The bind listener to be removed.
public void incomingTCPConnection(ServerSocketThread t, java.net.Socket s)
incomingTCPConnection
in interface ServerSocketThreadObserver
t
- The ServerSocketThread that created and holds the server.s
- The socket for the incoming connection.public void incomingUDPConnection(ServerSocketThread t, java.net.DatagramSocket s)
incomingUDPConnection
in interface ServerSocketThreadObserver
t
- The ServerSocketThread that created and holds the server.s
- The socket for the incoming connection.public void serverSocketClosed(ServerSocketThread t)
serverSocketClosed
in interface ServerSocketThreadObserver
t
- The ServerSocketThread that created and holds the server.public void serverSocketException(ServerSocketThread t, java.io.IOException e)
serverSocketException
in interface ServerSocketThreadObserver
t
- The ServerSocketThread that created and holds the server.e
- The Exception that was fetched.serverSocketException( ServerSocketThread, SocketTimeoutException )
public void serverSocketException(ServerSocketThread t, java.lang.SecurityException e)
serverSocketException
in interface ServerSocketThreadObserver
t
- The ServerSocketThread that created and holds the server.e
- The Exception that was fetched.public void serverSocketException(ServerSocketThread t, java.net.SocketTimeoutException e)
serverSocketException
in interface ServerSocketThreadObserver
t
- The ServerSocketThread that created and holds the server.e
- The Exception that was fetched.public void serverSocketException(ServerSocketThread t, java.nio.channels.IllegalBlockingModeException e)
serverSocketException
in interface ServerSocketThreadObserver
t
- The ServerSocketThread that created and holds the server.e
- The Exception that was fetched.public java.util.UUID bind(java.net.InetAddress address, int port, Environment<java.lang.String,BasicType> bindSettings) throws java.io.IOException, java.security.GeneralSecurityException
address
- port
- bindSettings
- This map may contain optional settings.
java.io.IOException
java.security.GeneralSecurityException
public void release(java.util.UUID socketID) throws java.io.IOException
java.io.IOException
public java.util.Map<java.lang.String,BasicType> getServerSettings(java.util.UUID socketID)
public void closeAllServerSockets()
public void finalize(long time, java.util.concurrent.TimeUnit unit)
public void run()
run
in interface java.lang.Runnable
public java.lang.String getStatusString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |