|
Remote System Explorer DataStore Release 3.3 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
org.eclipse.dstore.core.server.SecuredThread
org.eclipse.dstore.core.model.Handler
org.eclipse.dstore.core.model.CommandHandler
public abstract class CommandHandler
Abstract class for handling commands. A CommandHandler
is a
Handler
that contains a queue of commands to be sent to miners.
Each DataStore instance uses a single command handler that periodically sends
it's queue either to a server or directly to miners.
The CommandHandler is the means by which the DataStore sends information or files from the client to the remote tools.
Field Summary | |
---|---|
protected ArrayList |
_classesToSend
|
protected ArrayList |
_commands
|
Fields inherited from class org.eclipse.dstore.core.model.Handler |
---|
_keepRunning, _waitIncrement |
Fields inherited from class org.eclipse.dstore.core.server.SecuredThread |
---|
_dataStore |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
CommandHandler()
Constructor |
Method Summary | |
---|---|
void |
addCommand(DataElement command,
boolean immediate)
Adds a command object to the queue |
void |
cancelAllCommands()
Removes and affectively cancels all commands from the current queue of commands |
DataElement |
command(DataElement cmd)
Add a command object to the command queue |
DataElement |
command(DataElement commandDescriptor,
ArrayList arguments,
DataElement object,
boolean refArg,
boolean immediate)
Create and add a new command object to the command queue. |
DataElement |
command(DataElement cmd,
boolean immediate)
Add a command object to the command queue |
DataElement |
command(DataElement commandDescriptor,
DataElement object,
boolean refArg)
Create and add a new command object to the command queue. |
DataElement |
command(DataElement commandDescriptor,
DataElement arg,
DataElement object,
boolean refArg,
boolean immediate)
Create and add a new command object to the command queue. |
CommandGenerator |
getCommandGenerator()
|
DataStore |
getDataStore()
Returns the associated DataStore |
void |
handle()
Periodically called to send commands from the queue. |
abstract void |
requestClass(String className)
Implemented to provide the means by which classes are requested across the comm channel. |
abstract void |
sendAppendFile(String fileName,
byte[] bytes,
int size,
boolean binary)
Implemented to provide the means by which file bytes are sent and appended |
abstract void |
sendAppendFile(String fileName,
byte[] bytes,
int size,
boolean binary,
String byteStreamHandlerId)
Implemented to provide the means by which file bytes are sent and appended |
abstract void |
sendClass(String className)
Implemented to provide the means by which classes are sent across the comm channel. |
abstract void |
sendClass(String className,
String classByteStreamHandlerId)
Implemented to provide the means by which classes are sent across the comm channel. |
abstract void |
sendClassInstance(IRemoteClassInstance runnable,
String classByteStreamHandlerId)
Runs the specified class on the remote system |
abstract void |
sendCommands()
Implemented to provide the means by which commands in the queue are sent |
abstract void |
sendFile(String fileName,
byte[] bytes,
int size,
boolean binary)
Implemented to provide the means by which file bytes are sent |
abstract void |
sendFile(String fileName,
byte[] bytes,
int size,
boolean binary,
String byteStreamHandlerId)
Implemented to provide the means by which file bytes are sent |
abstract void |
sendKeepAliveConfirmation()
|
abstract void |
sendKeepAliveRequest()
|
void |
setDataStore(DataStore dataStore)
Sets the associated DataStore |
void |
waitForInput()
Causes the current thread to wait until this class request has been fulfilled. |
Methods inherited from class org.eclipse.dstore.core.model.Handler |
---|
finish, getWaitTime, isFinished, notifyInput, run, setWaitTime |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, 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 |
---|
protected ArrayList _commands
protected ArrayList _classesToSend
Constructor Detail |
---|
public CommandHandler()
Method Detail |
---|
public void setDataStore(DataStore dataStore)
setDataStore
in class Handler
public DataStore getDataStore()
public void addCommand(DataElement command, boolean immediate)
command
- the command to add to the queueimmediate
- indicates whether the command should be inserted first in the queue
or whether it should be appended.public void handle()
handle
in class Handler
public DataElement command(DataElement commandDescriptor, ArrayList arguments, DataElement object, boolean refArg, boolean immediate)
commandDescriptor
- the descriptor for the new commandarguments
- the arguments for the commandobject
- the subject of the commandrefArg
- indicates whether the subject should be represented in the command as a
reference to the subject or the actual subject, itselfimmediate
- indicates whether the command should be first in the queue or appended to it
public DataElement command(DataElement commandDescriptor, DataElement arg, DataElement object, boolean refArg, boolean immediate)
commandDescriptor
- the descriptor for the new commandarg
- the arg for the commandobject
- the subject of the commandrefArg
- indicates whether the subject should be represented in the command as a
reference to the subject or the actual subject, itselfimmediate
- indicates whether the command should be first in the queue or appended to it
public DataElement command(DataElement commandDescriptor, DataElement object, boolean refArg)
commandDescriptor
- the descriptor for the new commandobject
- the subject of the commandrefArg
- indicates whether the subject should be represented in the command as a
reference to the subject or the actual subject, itself
public DataElement command(DataElement cmd)
cmd
- the command object to add to the queue
public DataElement command(DataElement cmd, boolean immediate)
cmd
- the command object to add to the queueimmediate
- indicates whether the command is to be inserted first in the queue or appended
public void cancelAllCommands()
public CommandGenerator getCommandGenerator()
public abstract void sendCommands()
public abstract void sendFile(String fileName, byte[] bytes, int size, boolean binary)
fileName
- the name of the file to sendbytes
- to bytes of the file to sendsize
- the number of bytes to sendbinary
- indicates whether to send the bytes as binary or textpublic abstract void sendFile(String fileName, byte[] bytes, int size, boolean binary, String byteStreamHandlerId)
fileName
- the name of the file to sendbytes
- to bytes of the file to sendsize
- the number of bytes to sendbinary
- indicates whether to send the bytes as binary or textbyteStreamHandlerId
- indicates which byte stream handler to receive the bytes withpublic abstract void sendAppendFile(String fileName, byte[] bytes, int size, boolean binary)
fileName
- the name of the file to sendbytes
- to bytes of the file to sendsize
- the number of bytes to sendbinary
- indicates whether to send the bytes as binary or textpublic abstract void sendAppendFile(String fileName, byte[] bytes, int size, boolean binary, String byteStreamHandlerId)
fileName
- the name of the file to sendbytes
- to bytes of the file to sendsize
- the number of bytes to sendbinary
- indicates whether to send the bytes as binary or textbyteStreamHandlerId
- indicates which byte stream handler to receive the bytes withpublic abstract void sendClass(String className)
className
- the name of the class to sendpublic abstract void sendClass(String className, String classByteStreamHandlerId)
className
- the name of the class to sendclassByteStreamHandlerId
- indicates which class byte stream handler to receive the class withpublic abstract void sendClassInstance(IRemoteClassInstance runnable, String classByteStreamHandlerId)
public void waitForInput()
waitForInput
in class Handler
public abstract void requestClass(String className)
className
- the name of the class to requestpublic abstract void sendKeepAliveConfirmation()
public abstract void sendKeepAliveRequest()
|
Remote System Explorer DataStore Release 3.3 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |