Klasse Main

java.lang.Object
org.apache.fulcrum.yaafi.cli.Main
Alle implementierten Schnittstellen:
Runnable, org.apache.avalon.framework.activity.Disposable

public class Main extends Object implements Runnable, org.apache.avalon.framework.activity.Disposable
An example of the embedding of a YAAFI kernel inside an arbitrary application.
  • Felddetails

    • APPLICATION_NAME

      public static final String APPLICATION_NAME
      parameter for the application name
      Siehe auch:
    • APPLICATION_HOME

      public static final String APPLICATION_HOME
      parameter for the application home directory
      Siehe auch:
    • APPLICATION_TEMP

      public static final String APPLICATION_TEMP
      parameter for the application temporary directory
      Siehe auch:
    • APPLICATION_CONFIG

      public static final String APPLICATION_CONFIG
      parameter for the application container configuration file
      Siehe auch:
    • APPLICATION_HASSHUTDOWNHOOK

      public static final String APPLICATION_HASSHUTDOWNHOOK
      parameter for setting a shutdown hook
      Siehe auch:
    • APPLICATION_ISBLOCKING

      public static final String APPLICATION_ISBLOCKING
      parameter for blocking the main thread in Main.run()
      Siehe auch:
  • Konstruktordetails

    • Main

      public Main()
      Constructor
    • Main

      public Main(String[] args)
      Constructor The following command line parameters are supported
      • --yaafi.cli.applicationName name
      • --yaafi.cli.applicationHome dir
      • --yaafi.cli.tempHome dir
      • --yaafi.cli.isBlocking [true|false]
      • --yaafi.cli.hasShutdownHook [true|false]
      • --yaafi.cli.config file
      Parameter:
      args - the command line arguments
  • Methodendetails

    • main

      public static void main(String[] args) throws Exception
      The main method.
      Parameter:
      args - Command line arguments
      Löst aus:
      Exception - the execution failed
    • makeAbsoluteFile

      public static File makeAbsoluteFile(File baseDir, String name)
      Determines the file location of the given name. If the name denotes a relative file location it will be resolved using the application home directory.
      Parameter:
      baseDir - the base directory
      name - the filename
      Gibt zurück:
      the file
    • dispose

      public void dispose()
      Dispose the YAAFI container
      Angegeben von:
      dispose in Schnittstelle org.apache.avalon.framework.activity.Disposable
    • run

      public void run()
      Runs the instance by initializing it and potentially blocking the invoking thread depending on the configuration.
      Angegeben von:
      run in Schnittstelle Runnable
      Siehe auch:
    • onWait

      public void onWait()
      Depending on the configuration this method might block the calling thread or return immediately. We currently poll a volatile variable which is not the most elegant solution.
    • makeAbsoluteFile

      public File makeAbsoluteFile(String fileName)
      Locates the file for the given file name.
      Parameter:
      fileName - the filename
      Gibt zurück:
      an absolute file
    • makeAbsolutePath

      public String makeAbsolutePath(String fileName)
      Locates the file for the given file name.
      Parameter:
      fileName - the filename
      Gibt zurück:
      an absolute path
    • getServiceContainer

      public ServiceContainer getServiceContainer()
      Gibt zurück:
      Returns the ServiceContainer interface
    • getServiceManager

      public org.apache.avalon.framework.service.ServiceManager getServiceManager()
      Gibt zurück:
      Returns the ServiceManager interface
    • getApplicationHome

      public String getApplicationHome()
      Gibt zurück:
      Returns the applicationHome.
    • setApplicationHome

      public void setApplicationHome(String applicationHome)
      Parameter:
      applicationHome - The applicationHome to set.
    • getContainerConfigValue

      public String getContainerConfigValue()
      Gibt zurück:
      Returns the containerConfigValue.
    • setContainerConfigValue

      public void setContainerConfigValue(String containerConfigValue)
      Parameter:
      containerConfigValue - The containerConfigValue to set.
    • isBlocking

      public boolean isBlocking()
      Gibt zurück:
      Returns the isBlocking.
    • setIsBlocking

      public void setIsBlocking(boolean isBlocking)
      Parameter:
      isBlocking - The isBlocking to set.
    • setIsBlocking

      public void setIsBlocking(Boolean isBlocking)
      Parameter:
      isBlocking - The isBlocking to set.
    • setIsBlocking

      public void setIsBlocking(String isBlocking)
      Parameter:
      isBlocking - The isBlocking to set.
    • getTempHome

      public String getTempHome()
      Gibt zurück:
      Returns the tempHome.
    • setTempHome

      public void setTempHome(String tempHome)
      Parameter:
      tempHome - The tempHome to set.
    • getLogger

      public org.apache.avalon.framework.logger.Logger getLogger()
      Gibt zurück:
      Returns the logger.
    • setLogger

      public void setLogger(org.apache.avalon.framework.logger.Logger logger)
      Parameter:
      logger - The logger to set.
    • getApplicationName

      public String getApplicationName()
      Gibt zurück:
      Returns the applicationName.
    • setApplicationName

      public void setApplicationName(String applicationName)
      Parameter:
      applicationName - The applicationName to set.
    • getArgs

      public String[] getArgs()
      Gibt zurück:
      Returns the args.
    • setArgs

      public void setArgs(String[] args)
      Parameter:
      args - The args to set.
    • hasShutdownHook

      public boolean hasShutdownHook()
      Gibt zurück:
      Returns the hasShutdownHook.
    • setHasShutdownHook

      public void setHasShutdownHook(boolean hasShutdownHook)
      Parameter:
      hasShutdownHook - The hasShutdownHook to set.
    • setHasShutdownHook

      public void setHasShutdownHook(Boolean hasShutdownHook)
      Parameter:
      hasShutdownHook - The hasShutdownHook to set.
    • setHasShutdownHook

      public void setHasShutdownHook(String hasShutdownHook)
      Parameter:
      hasShutdownHook - The hasShutdownHook to set.
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object
      Siehe auch:
    • isInitialized

      public boolean isInitialized()
      Gibt zurück:
      Returns the isInitialized.
    • setInitialized

      protected void setInitialized(boolean isInitialized)
      Parameter:
      isInitialized - The isInitialized to set.
    • initialize

      public void initialize() throws Exception
      Initialize the instance
      Löst aus:
      Exception - the initialization failed
    • shutdown

      protected void shutdown()
      Terminates the instance