osnap.api.net
Class MessageReceiver

java.lang.Object
  extended by java.lang.Thread
      extended by osnap.api.net.MessageReceiver
All Implemented Interfaces:
java.lang.Runnable

public class MessageReceiver
extends java.lang.Thread

The MessageReceiver is used by modules to receive messages from Core


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
private  java.net.Socket _coreSocket
           
private  ModuleInterface _module
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
MessageReceiver(java.net.Socket socket, ModuleInterface module)
          Creates a new MessageReceiver
 
Method Summary
 void run()
          This thread will listen for new messages from Core.
 
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
 

Field Detail

_coreSocket

private java.net.Socket _coreSocket

_module

private ModuleInterface _module
Constructor Detail

MessageReceiver

public MessageReceiver(java.net.Socket socket,
                       ModuleInterface module)
Creates a new MessageReceiver

Parameters:
socket - Socket connected to Core
module - ModuleInterface using the MessageReceiver
Method Detail

run

public void run()
This thread will listen for new messages from Core.
If the connection is closed, this thread will destroy itself

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread