Package net.messagevortex
Class MessageVortex
java.lang.Object
net.messagevortex.MessageVortex
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncall()static ObjectgetConfiguredClass(String section, String name, Class templateClass) Loads a class of the given type.static RunningDaemonThis is a wrapper of the getConfiguredClass() methode.static voidMain command line method.static intmainReturn(String[] args) Wrapper function as entry point for tests.
-
Field Details
-
CONFIG_FAIL
public static final int CONFIG_FAIL- See Also:
-
SETUP_FAIL
public static final int SETUP_FAIL- See Also:
-
ARGUMENT_FAIL
public static final int ARGUMENT_FAIL- See Also:
-
-
Constructor Details
-
MessageVortex
public MessageVortex()
-
-
Method Details
-
main
Main command line method.
- Parameters:
args- command line parameters
-
mainReturn
Wrapper function as entry point for tests.
- Parameters:
args- command line arguments- Returns:
- the errorlevel to be returned
-
call
-
getDaemon
public static RunningDaemon getDaemon(String section, String classname, net.messagevortex.MessageVortex.DaemonType type) throws ClassNotFoundException This is a wrapper of the getConfiguredClass() methode.
It modifies the return type to a RunningDaemon.
- Parameters:
section- the name of the section where the config should be taken fromclassname- the name of the class to be instantiatedtype- the type of daemon to be checked- Returns:
- the specified object
- Throws:
ClassNotFoundException- if classname not found
-
getConfiguredClass
public static Object getConfiguredClass(String section, String name, Class templateClass) throws ClassNotFoundException Loads a class of the given type.
The class must have the same or a subtype of the template class and must provide a String constructor, taking the name of the config section.
- Parameters:
section- the configuration section where the class was mentioned (for information purposes in output and to load subsequent data)name- the Name of the classtemplateClass- a template class. The loaded class must be the same or a subtyppe of the template class- Returns:
- the loaded class
- Throws:
ClassNotFoundException- if the named class cannot be found
-