org.starhope.appius.net
Class CaesarServer
java.lang.Object
java.lang.Thread
org.starhope.appius.net.NetIOThread
org.starhope.appius.net.CaesarServer
- All Implemented Interfaces:
- Comparable<Thread>, Runnable, Thread.UncaughtExceptionHandler, NetIOHandlerPeer, ServerProcessor, AcceptsMetronomeTicks, HasName, CanProcessCommands
public class CaesarServer
- extends NetIOThread
- implements ServerProcessor
- Author:
- brpocock@star-hope.org
|
Constructor Summary |
CaesarServer(Socket sock)
WRITEME: Document this constructor brpocock@star-hope.org |
| Methods inherited from class org.starhope.appius.net.NetIOThread |
checkInputStream, compareTo, doProcessing, dropSocket_socketCore, dropSocketConnection, equals, equals, getLanguage_dialect, getSocket, getVerboseBugReplies, hashCode, isDebug, isParallelMode, processInput, sendError_RAW, sendRawMessageNow, setDebug, setLanguage, setVerboseBugReplies, superVerbose, tattle, tattle, toInfinityAndBeyond |
| 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, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from interface org.starhope.appius.util.HasName |
getName |
CaesarServer
public CaesarServer(Socket sock)
- WRITEME: Document this constructor brpocock@star-hope.org
- Parameters:
sock - the socket connected to the other endpoint
processInput_Infinity
protected String processInput_Infinity(String theInput)
- Description copied from class:
NetIOThread
- Process input received using the JSON-based Infinity mode
- Specified by:
processInput_Infinity in class NetIOThread
- Parameters:
theInput - the input string identified as being
Infinity-mode data
- Returns:
- a response for the other party in the communication
- See Also:
NetIOThread.processInput_Infinity(java.lang.String)
sendRawMessageLater
protected void sendRawMessageLater(String reply)
throws UserDeadException
- Description copied from class:
NetIOThread
- Send a message to the user in future
- Specified by:
sendRawMessageLater in class NetIOThread
- Parameters:
reply - The message to be sent in future
- Throws:
UserDeadException - if the user is already gone- See Also:
NetIOThread.sendRawMessageLater(java.lang.String)
sendResponse
public void sendResponse(org.json.JSONObject result)
throws UserDeadException
- Description copied from class:
NetIOThread
- Send a response as a future (deferred remote) datagram without a
room specified
- Specified by:
sendResponse in interface CanProcessCommands- Specified by:
sendResponse in class NetIOThread
- Parameters:
result - a JSON-encoded response
- Throws:
UserDeadException - if the user disconnects- See Also:
NetIOThread.sendResponse(org.json.JSONObject)
setBusyState
public void setBusyState(boolean b)
- Specified by:
setBusyState in interface CanProcessCommands
- Parameters:
b - whether the thread or processor is “busy”- See Also:
CanProcessCommands.setBusyState(boolean)
setLastInputTime
public void setLastInputTime(long thatTime)
- Specified by:
setLastInputTime in interface CanProcessCommands
- Parameters:
thatTime - WRITEME- See Also:
CanProcessCommands.setLastInputTime(long)
tattlePrefix
protected String tattlePrefix()
- Description copied from class:
NetIOThread
- WRITEME: Document this method brpocock@star-hope.org
- Specified by:
tattlePrefix in class NetIOThread
- Returns:
- WRITEME
- See Also:
NetIOThread.tattlePrefix()
tick
public void tick(long currentTime,
long deltaTime)
throws UserDeadException
- Description copied from interface:
AcceptsMetronomeTicks
- This method is called periodically from the metronome thread. To
save computation, it receives both the current time since epoch
in milliseconds at the start of the global tick propagation, and
the delta time since the previous metronome tick.
- Specified by:
tick in interface AcceptsMetronomeTicks
- Parameters:
currentTime - Time since epoch at the start of the global
metronome propagation, as per
System.currentTimeMillis()deltaTime - Delta-time in milliseconds since the prior
global metronome tick
- Throws:
UserDeadException - if a user has died during this tick- See Also:
AcceptsMetronomeTicks.tick(long, long)
uncaughtException
public void uncaughtException(Thread t,
Throwable e)
- Specified by:
uncaughtException in interface Thread.UncaughtExceptionHandler
- See Also:
Thread.UncaughtExceptionHandler.uncaughtException(java.lang.Thread,
java.lang.Throwable)