java.lang.Object
net.i2p.router.startup.LoadClientAppsJob.RunApp
All Implemented Interfaces:
Runnable
Enclosing class:
LoadClientAppsJob

private static final class LoadClientAppsJob.RunAppextends Object implements Runnable
Runner that loads and starts one client app.
  • Field Details

    • _className

      private final String _className
      Class name of the app to run.
    • _appName

      private final String _appName
      Name of the app for the logs.
    • _args

      private final String[] _args
      Arguments passed to the app.
    • _ctx

      private final RouterContext _ctx
      The router context.
    • _log

      private final Log _log
      Logger for the app loading.
    • _cl

      private final ClassLoader _cl
      Class loader for the app's classes.
  • Constructor Details

    • RunApp

      public RunApp(String className, String appName, String[] args, RouterContext ctx, Log log, ClassLoader cl)
      Creates the runnable that loads and starts one client application class.
      Parameters:
      className - the class name of the app to run
      appName - the name of the app for the logs
      args - the arguments passed to the app
      ctx - the router context
      log - the logger for the app loading
      cl - the class loader for the app's classes, null for the default
  • Method Details

    • run

      public void run()
      Load and start the client application.
      Specified by:
      run in interface Runnable
    • isRouterApp

      private static boolean isRouterApp(Class<?> cls)
      Checks whether the class is a router app.
      Parameters:
      cls - the class to check
      Returns:
      true if it is a router app
    • isClientApp

      private static boolean isClientApp(Class<?> cls)
      Checks whether the class is a client app.
      Parameters:
      cls - the class to check
      Returns:
      true if it is a client app
    • isInterface

      private static boolean isInterface(Class<?> cls, Class<?> intfc)
      Checks whether the class implements an interface.
      Parameters:
      cls - the class to check
      intfc - the interface to look for
      Returns:
      true if the interface is implemented