Class ApplicationPreStartEvent
java.lang.Object
eu.cloudnetservice.driver.event.Event
eu.cloudnetservice.wrapper.event.ApplicationPreStartEvent
public final class ApplicationPreStartEvent
extends eu.cloudnetservice.driver.event.Event
An event called when the underlying application of the wrapper is about to be started. This event cannot be used by
platform plugins or extensions, as this event is fired before they get enabled.
- Since:
- 4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Class<?> private final Collection<String> private final ClassLoader -
Constructor Summary
ConstructorsConstructorDescriptionApplicationPreStartEvent(@NonNull Class<?> applicationMainClass, @NonNull Collection<String> arguments, @NonNull ClassLoader classLoader) Constructs a new ApplicationPreStartEvent instance. -
Method Summary
Modifier and TypeMethodDescriptionGet the main class which was invoked when starting the application.Get the arguments which will be passed to the application when starting.Get the class loader which was used to load the main class of the application (and all other classes of the application in the runtime unless the application decides to switch to another loader).
-
Field Details
-
applicationMainClass
-
arguments
-
classLoader
-
-
Constructor Details
-
ApplicationPreStartEvent
public ApplicationPreStartEvent(@NonNull @NonNull Class<?> applicationMainClass, @NonNull @NonNull Collection<String> arguments, @NonNull @NonNull ClassLoader classLoader) Constructs a new ApplicationPreStartEvent instance.- Parameters:
applicationMainClass- the main class instance which will be invoked to start the application.arguments- the process arguments which will be passed to the application.classLoader- the class loader which loaded the application main class.- Throws:
NullPointerException- if the given application main, arguments or class loader is null.
-
-
Method Details
-
applicationMainClass
-
arguments
Get the arguments which will be passed to the application when starting. The returned collection is modifiable and can be used to change the arguments before starting.- Returns:
- the arguments which will be passed to the application as process arguments.
-
classLoader
Get the class loader which was used to load the main class of the application (and all other classes of the application in the runtime unless the application decides to switch to another loader).- Returns:
- the class loader of the application main class.
-