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 Details

    • applicationMainClass

      private final Class<?> applicationMainClass
    • arguments

      private final Collection<String> arguments
    • classLoader

      private final ClassLoader 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

      @NonNull public @NonNull Class<?> applicationMainClass()
      Get the main class which was invoked when starting the application.
      Returns:
      the invoked main class of the application.
    • arguments

      @NonNull public @NonNull Collection<String> 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

      @NonNull public @NonNull ClassLoader 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.