Class PlatformMain


  • public abstract class PlatformMain
    extends java.lang.Object
    Useful delegation model for starting a hk2 instance using a service based lookup
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) java.util.List<java.lang.Object> contexts  
      protected java.util.logging.Logger logger  
      protected java.io.File root  
    • Constructor Summary

      Constructors 
      Constructor Description
      PlatformMain()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      <T> T getContext​(java.lang.Class<T> contextType)  
      java.util.List<java.lang.Object> getContexts()  
      java.util.logging.Logger getLogger()  
      abstract java.lang.String getName()
      Returns the platform name associated with this main.
      <T> T getStartedService​(java.lang.Class<T> serviceType)
      Optional method.
      void setContext​(java.lang.Object context)  
      void setLogger​(java.util.logging.Logger logger)  
      abstract void start​(java.util.Properties ctx)
      Starts the main entry point using this platform implementation.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • logger

        protected java.util.logging.Logger logger
      • root

        protected java.io.File root
      • contexts

        java.util.List<java.lang.Object> contexts
    • Constructor Detail

      • PlatformMain

        public PlatformMain()
    • Method Detail

      • getLogger

        public java.util.logging.Logger getLogger()
      • setLogger

        public void setLogger​(java.util.logging.Logger logger)
      • setContext

        public void setContext​(java.lang.Object context)
      • getContext

        public <T> T getContext​(java.lang.Class<T> contextType)
      • getContexts

        public java.util.List<java.lang.Object> getContexts()
      • getName

        public abstract java.lang.String getName()
        Returns the platform name associated with this main.
        Returns:
        ther plaform name
      • start

        public abstract void start​(java.util.Properties ctx)
                            throws java.lang.Exception
        Starts the main entry point using this platform implementation.
        Parameters:
        ctx - Context in which this object executes. It contains arguments passed to the program as well.
        Throws:
        java.lang.Exception - if anything goes wrong
      • getStartedService

        public <T> T getStartedService​(java.lang.Class<T> serviceType)
        Optional method. Returns singleton services after the start method was executed successfully.
        Type Parameters:
        T - service type
        Parameters:
        serviceType - type of the requested service
        Returns:
        service instance