| Modifier and Type | Field and Description |
|---|---|
private static boolean |
closed |
private static Component |
component |
private static int |
ERROR_EXIT_CODE
Exit code that is used if the program has to terminate because of an
internal error.
|
private static org.slf4j.Logger |
LOGGER |
| Constructor and Description |
|---|
ComponentStarter() |
| Modifier and Type | Method and Description |
|---|---|
private static void |
addShutdownHook() |
private static void |
closeComponent() |
private static Component |
createComponentInstance(String className)
This method simply creates an instance of the given class by calling a
constructor that needs no arguments and cats the newly created instance
into a
Component instance. |
static void |
main(String[] args)
This is the main method creating and starting an instance of a
Component with the given class name. |
private static final org.slf4j.Logger LOGGER
private static final int ERROR_EXIT_CODE
private static Component component
private static boolean closed
public static void main(String[] args)
Component with the given class name.args - The first element has to be the class name of the component.private static Component createComponentInstance(String className) throws ClassNotFoundException, NoSuchMethodException, SecurityException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException
Component instance. Note that this method assumes that a)
there is a constructor that needs no arguments to be executed and b) the
class with the given name is implementing the Constructor
interface.className - the name of the class implementing the Component
interface.ClassNotFoundException - - If the class with the given name can not be found.NoSuchMethodException - - If there is no constructor that needs no parameters.SecurityException - - If the constructor can not be accessed because of security
policies.InstantiationException - - If the class with the given class name represents an
abstract class.IllegalAccessException - - If the Constructor object is enforcing Java language access
control and the underlying constructor is inaccessible.IllegalArgumentException - - If the number of actual and formal parameters differ; if an
unwrapping conversion for primitive arguments fails; or if,
after possible unwrapping, a parameter value cannot be
converted to the corresponding formal parameter type by a
method invocation conversion; if this constructor pertains to
an enum type. (Should not occur)InvocationTargetException - - If the constructor throws an exception.private static void closeComponent()
private static void addShutdownHook()
Copyright © 2017–2018. All rights reserved.