|
OpenNMS API 1.1.4 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.opennms.core.concurrent.VMTaskFiber
| Field Summary | |
private java.lang.ClassLoader |
m_classLoader
The class loader used to resolve classes for the thread group. |
private java.lang.Class |
m_entryClass
The entry class. |
private java.lang.reflect.Method |
m_entryMethod
The entry method. |
private int |
m_fiberStatus
The fiber's status. |
private java.lang.String[] |
m_mainArgs
The entry arguments. |
private java.lang.String |
m_taskName
The name of the VM task. |
private java.lang.ThreadGroup |
m_thrGroup
The thread group for the task. |
private static java.lang.String |
MAIN_METHOD_NAME
The name of the entry method. |
private static java.lang.String[] |
MAIN_PARAMETER_TYPES
The list of classes that are passed as entry arguments. |
private static java.lang.String |
MAIN_RETURN_TYPE
The return type for the entry method. |
private static java.lang.String |
THREADGROUP_NAME_PREFIX
The name prefixed to the task name to form the name for the thread group. |
| Fields inherited from interface org.opennms.core.fiber.Fiber |
RUNNING, START_PENDING, STARTING, STATUS_NAMES, STOP_PENDING, STOPPED |
| Constructor Summary | |
VMTaskFiber(java.lang.String taskName,
java.lang.String entryClassName,
java.lang.String[] entryArguments,
java.net.URL[] searchPaths)
Constructs a new Virtual Macine Task Fiber. |
|
| Method Summary | |
private static java.lang.reflect.Method |
findMain(java.lang.Class c)
This method attempts to find the method with the signature public static void main(String[]) if it is part of the passed class. |
java.lang.String |
getName()
Returns the name for the virtual machine task. |
int |
getStatus()
Returns the current status of the fiber. |
void |
run()
This method invokes the entry method on the main class. |
void |
start()
Starts the current fiber running. |
void |
stop()
Stops the current fiber. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private static final java.lang.String MAIN_METHOD_NAME
main.
private static final java.lang.String[] MAIN_PARAMETER_TYPES
private static final java.lang.String MAIN_RETURN_TYPE
private static final java.lang.String THREADGROUP_NAME_PREFIX
private java.lang.String m_taskName
private java.lang.ThreadGroup m_thrGroup
private java.lang.ClassLoader m_classLoader
private java.lang.Class m_entryClass
private java.lang.reflect.Method m_entryMethod
private java.lang.String[] m_mainArgs
private int m_fiberStatus
| Constructor Detail |
public VMTaskFiber(java.lang.String taskName,
java.lang.String entryClassName,
java.lang.String[] entryArguments,
java.net.URL[] searchPaths)
throws java.lang.ClassNotFoundException,
java.lang.NoSuchMethodException
taskName - The name of the taskentryClassName - The name of the entry class.entryArguments - The String array passed to main.searchPaths - The URL's used to locate resources and classes.
java.lang.ClassNotFoundException - Thrown if the entry class is
not found.
java.lang.NoSuchMethodException - Thrown if the main
is not found on the entry class.URLClassLoader| Method Detail |
private static java.lang.reflect.Method findMain(java.lang.Class c)
This method attempts to find the method with the signature public static void main(String[]) if it is part of the passed class. The first matching method is returned to the caller.
c - The class to search for the main method.
public void run()
run in interface java.lang.Runnablepublic void start()
start in interface Fiberpublic void stop()
STOP_PENDING. When the
main thread exits then the service is considered stopped!
stop in interface Fiberpublic int getStatus()
getStatus in interface Fiberpublic java.lang.String getName()
getName in interface Fiber
|
OpenNMS API 1.1.4 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||