atavism.server.engine
Class SocketPolicyHandler
java.lang.Object
atavism.server.engine.SocketPolicyHandler
- All Implemented Interfaces:
- TcpAcceptCallback
public class SocketPolicyHandler
- extends java.lang.Object
- implements TcpAcceptCallback
The SocketPolicyHandler serves up the socket policy file to the client.
Method Summary |
protected java.lang.Object |
createMBeanInstance()
Return JMX MBean instance object. |
void |
onTcpAccept(java.nio.channels.SocketChannel sc)
Read a request from our connection, and if it is well-formed, send
the current policy. |
protected void |
setPolicy(java.lang.String policy)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_POLICY
protected final java.lang.String DEFAULT_POLICY
- See Also:
- Constant Field Values
DEFAULT_PORT
protected final int DEFAULT_PORT
- See Also:
- Constant Field Values
POLICY_REQUEST_STRING
protected final java.lang.String POLICY_REQUEST_STRING
- See Also:
- Constant Field Values
tcpServer
protected TcpServer tcpServer
port
protected int port
policy
protected java.lang.String policy
policyBuffer
protected java.nio.ByteBuffer policyBuffer
idleTimeout
public static int idleTimeout
- Player idle timeout in seconds. If there has been no activity from
the client, then the connection is closed.
SocketPolicyHandler
public SocketPolicyHandler(java.util.Properties properties)
createMBeanInstance
protected java.lang.Object createMBeanInstance()
- Return JMX MBean instance object. Over-ride to provide your
own MBean implementation.
onTcpAccept
public void onTcpAccept(java.nio.channels.SocketChannel sc)
- Read a request from our connection, and if it is well-formed, send
the current policy.
- Specified by:
onTcpAccept
in interface TcpAcceptCallback
setPolicy
protected void setPolicy(java.lang.String policy)