|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectappl.parallel.thread.ExecutionThread
public abstract class ExecutionThread
A simple helper class for more easy Thread handling with anonymous classes.
DataServerThread
,
ComputingResourceThread
Field Summary | |
---|---|
protected Object |
argument
|
protected CommEvent.CommType |
commType
|
protected boolean |
disableTransferEvents
|
protected CommEventSink |
eventSink
|
protected Object |
server
|
protected ComputingResourceProperties |
serverInfos
|
Constructor Summary | |
---|---|
ExecutionThread(Object server,
ComputingResourceProperties serverInfos,
Object argument,
CommEvent.CommType type,
CommEventSink sink,
boolean disableTransferEvents)
creates a new thread |
Method Summary | |
---|---|
Object |
call()
Sends standard CommEvents to the CommEventSink given with the
constructor. |
protected void |
fireTimeEvents(long execTime,
Object result)
Sends the time events for this execution. |
protected void |
fireTransferEvent(Object result)
The TransferEvents for this execution. |
protected int |
getIntArgument()
|
protected Object |
getObjectArgument()
|
protected Object[] |
getObjectArrayArgument()
|
protected Object |
getServer()
|
protected abstract Object |
run()
This method should implement the real running code. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final Object server
protected final Object argument
protected final CommEvent.CommType commType
protected final ComputingResourceProperties serverInfos
protected final CommEventSink eventSink
protected boolean disableTransferEvents
Constructor Detail |
---|
public ExecutionThread(Object server, ComputingResourceProperties serverInfos, Object argument, CommEvent.CommType type, CommEventSink sink, boolean disableTransferEvents)
server
- the server which is accessed with this threadserverInfos
- the serverinfos (used for event info)argument
- an argument which can be used inside the anonymous classtype
- the type of the communicationsink
- events are submitted to this sinkdisableTransferEvents
- says whether to ignore transfer events (if the transfer volume is to low to be counted))Method Detail |
---|
protected Object getServer()
protected int getIntArgument()
protected Object getObjectArgument()
protected Object[] getObjectArrayArgument()
public Object call() throws Exception
CommEvents
to the CommEventSink
given with the
constructor. Executes the run()
method and returns its result.
call
in interface Callable
run()
.
Exception
Callable.call()
protected void fireTimeEvents(long execTime, Object result)
execTime
- the time of THIS executionresult
- the result of the computation (may be of use when overwriting)protected void fireTransferEvent(Object result)
getObjectArgument()
.If you want more events
(e.g. details from a remote execution) you can overwrite this method.
This method is only called if time monitoring is enabled.
Notice that this will be very slow for large Data!!
result
- the result of the execution (per default not needed)protected abstract Object run() throws Exception
Exception
- the exceptions thrown by your code
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |