Class SingletonCreator.Creator<T>

    • Constructor Summary

      Constructors 
      Constructor Description
      Creator()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract T create()
      create the singleton instance
      protected void destroy​(T singleton)
      cleans up the singleton instance.
      protected abstract java.lang.Object getID()
      returns a unique id which is used in the internal cache map as the key for the singleton instance.
      protected boolean isExpired()  
      • Methods inherited from class java.lang.Object

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

      • Creator

        public Creator()
    • Method Detail

      • getID

        protected abstract java.lang.Object getID()
        returns a unique id which is used in the internal cache map as the key for the singleton instance.
        Returns:
        the unique ID
      • create

        protected abstract T create()
                             throws java.lang.Exception
        create the singleton instance
        Throws:
        java.lang.Exception
      • isExpired

        protected boolean isExpired()
        Returns:
        true if this creator is expired which means a new instance will be created (via create()) instead of returning an already created instance
      • destroy

        protected void destroy​(T singleton)
                        throws java.lang.Exception
        cleans up the singleton instance. this hookin method is invoked whenever SingletonCreator.destroy() is called.
        Throws:
        java.lang.Exception