|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.cometway.util.KMethod
public class KMethod
KMethod is a wrapper for java.lang.reflect.Method. This object allows Threads to easily pass code to be executed (a Method or a Runnable) around with each other. PooledThreads execute KMethods in order to maximize their efficiency by quickly determining what Threads will execute the code at Runtime. KMethods can also wrap classes that implement Runnable. Special instances of execution which may require state information or other specific runtime information can extend this class so that PooledThreads and ThreadPools can be utilized.
ThreadPool,
PooledThread| Field Summary | |
|---|---|
protected java.lang.Object[] |
args
|
protected java.lang.String |
debugName
|
protected java.lang.reflect.Method |
method
|
protected java.lang.Object |
obj
|
protected boolean |
print_errors
|
protected java.lang.Runnable |
run
|
protected boolean |
verbose
|
| Constructor Summary | |
|---|---|
KMethod()
Creates an empty KMethod. |
|
KMethod(java.lang.reflect.Method m,
java.lang.Object obj,
java.lang.Object[] args)
Create a KMethod around a java.lang.reflect.Method. |
|
KMethod(java.lang.Runnable run)
Create a KMethod around a Runnable. |
|
| Method Summary | |
|---|---|
protected void |
error(java.lang.String s)
|
protected void |
error(java.lang.String s,
java.lang.Exception e)
|
void |
execute()
Calling this will execute this KMethod, which executes what the KMethod wraps. |
protected void |
print(java.lang.String s)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String debugName
protected boolean print_errors
protected boolean verbose
protected java.lang.Object obj
protected java.lang.reflect.Method method
protected java.lang.Object[] args
protected java.lang.Runnable run
| Constructor Detail |
|---|
public KMethod(java.lang.Runnable run)
run - This is the Runnable which will be executed.
public KMethod(java.lang.reflect.Method m,
java.lang.Object obj,
java.lang.Object[] args)
m - This is the java.lang.reflect.Method to invoke.obj - This is passed to the Method when invoked.args - These are the arguments to pass to the Method when invoked.public KMethod()
| Method Detail |
|---|
public void execute()
protected void error(java.lang.String s,
java.lang.Exception e)
protected void error(java.lang.String s)
protected void print(java.lang.String s)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||