|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfabric.common.AbstractConnectionHandler<Node,Session,MessageHandlerThread>
Node
- a class for representing the nodes that can be connected to.Session
- a class of session objects.public abstract class AbstractConnectionHandler<Node,Session extends AbstractMessageHandlerThread.SessionAttributes,MessageHandlerThread extends AbstractMessageHandlerThread<Session,MessageHandlerThread>>
Abstraction for initializing incoming network connections and handing them off to a ChannelMultiplexerThread.
CommManager.connect()
Constructor Summary | |
---|---|
protected |
AbstractConnectionHandler(int poolSize,
AbstractMessageHandlerThread.Factory<MessageHandlerThread> handlerFactory)
|
Method Summary | |
---|---|
protected abstract Node |
getNodeByName(java.lang.String name)
|
protected abstract java.lang.String |
getThreadName(java.net.SocketAddress remote,
Session session)
Returns the name for the message-handler thread that will be handling the given connection. |
void |
handle(java.nio.channels.SocketChannel connection)
|
protected abstract void |
logAuthenticationFailure()
Logs an authentication failure of the remote host. |
protected abstract void |
logSession(java.net.SocketAddress remote,
Session session)
Logs a successful connection. |
protected abstract Session |
newAuthenticatedSession(Node node,
java.lang.String remoteNodeName,
java.lang.String remoteNodePrincipalName,
NodePrincipal remoteNodePrincipal)
|
protected Session |
newUnauthenticatedSession(Node node,
java.lang.String remoteNodeName)
|
void |
shutdown()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected AbstractConnectionHandler(int poolSize, AbstractMessageHandlerThread.Factory<MessageHandlerThread> handlerFactory)
Method Detail |
---|
protected abstract Node getNodeByName(java.lang.String name)
protected Session newUnauthenticatedSession(Node node, java.lang.String remoteNodeName)
node
- the local node with which the session was established.remoteNodeName
- the name of the remote node.
protected abstract Session newAuthenticatedSession(Node node, java.lang.String remoteNodeName, java.lang.String remoteNodePrincipalName, NodePrincipal remoteNodePrincipal)
node
- the local node with which the session was established.remoteNodeName
- the name of the remote node.remoteNodePrincipalName
- the String representation of the remote node's principal.remoteNodePrincipal
- the NodePrincipal corresponding to the remote node.
protected abstract void logAuthenticationFailure()
protected abstract void logSession(java.net.SocketAddress remote, Session session)
protected abstract java.lang.String getThreadName(java.net.SocketAddress remote, Session session)
public final void handle(java.nio.channels.SocketChannel connection)
public final void shutdown()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |