Package sc.obj

Class ComponentImpl

  • All Implemented Interfaces:
    IComponent, IStoppable

    public class ComponentImpl
    extends java.lang.Object
    implements IComponent
    When the @Component annotation class is used, this class is "mixed in" in an intelligent way into your class as part of the transformation from StrataCode into Java. The constructor code is moved into the preInit method. The init, start etc methods are implemented with dummy implementations or you can define them in your class. References to other objects can be recursive. Any referenced components initialized at the same time as the referencing component first all have their preInit methods called so you know all referenced preInit's have been called before your init methods is called. That means all references, even recursive ones are assigned when your init method is called. Then all init methods are run before the start method of the first component, etc.
    • Constructor Summary

      Constructors 
      Constructor Description
      ComponentImpl()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte getInitState()  
      void init()
      You can optionally implement this method to receive a initialization hook
      void preInit()  
      void start()
      You can optionally implement this method to receive a start hook
      void stop()
      You can optionally implement this method to receive a stop hook when your object or component is disposed
      • Methods inherited from class java.lang.Object

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

      • _initState

        protected byte _initState
    • Constructor Detail

      • ComponentImpl

        public ComponentImpl()
    • Method Detail

      • init

        public void init()
        Description copied from interface: IComponent
        You can optionally implement this method to receive a initialization hook
        Specified by:
        init in interface IComponent
      • start

        public void start()
        Description copied from interface: IComponent
        You can optionally implement this method to receive a start hook
        Specified by:
        start in interface IComponent
      • stop

        public void stop()
        Description copied from interface: IStoppable
        You can optionally implement this method to receive a stop hook when your object or component is disposed
        Specified by:
        stop in interface IStoppable