com.threerings.nio
Class PolicyServer

java.lang.Object
  extended by java.lang.Thread
      extended by com.samskivert.util.LoopingThread
          extended by com.threerings.nio.conman.ConnectionManager
              extended by com.threerings.nio.PolicyServer
All Implemented Interfaces:
Lifecycle.BaseComponent, Lifecycle.ShutdownComponent, Runnable

public class PolicyServer
extends ConnectionManager

Binds to a port and responds to "xmlsocket" requests on it with a policy file allowing access to all ports from any host.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.threerings.nio.conman.ConnectionManager
ConnectionManager.OverflowQueue, ConnectionManager.PartialWriteHandler
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
protected  ServerSocketChannelAcceptor _acceptor
           
protected  byte[] _policy
           
protected static int MASTER_PORT
           
 
Fields inherited from class com.threerings.nio.conman.ConnectionManager
_acceptedq, _connections, _deathq, _handlers, _idleTime, _lastDebugStamp, _oflowHandler, _oflowqs, _onExit, _outbuf, _outq, _selectLoopTime, _selector, _selectorSelector, _stats, ASYNC_CLOSE_REQUEST, DEBUG_REPORT, DEBUG_REPORT_INTERVAL, LATENCY_GRACE
 
Fields inherited from class com.samskivert.util.LoopingThread
_running
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
PolicyServer(Lifecycle cycle)
           
 
Method Summary
protected  void didShutdown()
           
protected  void handleAcceptedSocket(SocketChannel channel)
          Adds a connection for the given socket to the managed set.
 void init(int socketPolicyPort)
          Accepts xmlsocket requests on socketPolicyPort and responds any host may connect to any port on this host.
static void main(String[] args)
           
protected  void willStart()
           
 
Methods inherited from class com.threerings.nio.conman.ConnectionManager
closeConnection, connectionClosed, connectionFailed, getStats, handleAcceptedSocket, handleIncoming, handleIterateFailure, iterate, noteWrite, postAsyncClose, processIncomingEvents, register, sendOutgoingMessages, setShutdownAction, transferAcceptedSocket, writeMessage
 
Methods inherited from class com.samskivert.util.LoopingThread
isRunning, kick, run, shutdown
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.samskivert.util.Lifecycle.ShutdownComponent
shutdown
 

Field Detail

_acceptor

protected ServerSocketChannelAcceptor _acceptor

_policy

protected byte[] _policy

MASTER_PORT

protected static final int MASTER_PORT
See Also:
Constant Field Values
Constructor Detail

PolicyServer

@Inject
public PolicyServer(Lifecycle cycle)
             throws IOException
Throws:
IOException
Method Detail

main

public static void main(String[] args)

init

public void init(int socketPolicyPort)
Accepts xmlsocket requests on socketPolicyPort and responds any host may connect to any port on this host.


willStart

protected void willStart()
Overrides:
willStart in class ConnectionManager

didShutdown

protected void didShutdown()
Overrides:
didShutdown in class ConnectionManager

handleAcceptedSocket

protected void handleAcceptedSocket(SocketChannel channel)
Description copied from class: ConnectionManager
Adds a connection for the given socket to the managed set.

Specified by:
handleAcceptedSocket in class ConnectionManager