Class AbstractResource

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AbstractResource()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String currentState()
      Returns a string describing the current state of references in human-friendly terms.
      protected void destroy()
      This method signals that this AbstractResource can dispose of any internal resources, and commence with shut down of any internal threads.
      ResourceReference refer()
      Increments the reference count of this resource.
      void release()
      Releases the "main" reference to this resource (the implicit reference due to creation of the object).
      int retainCount()
      Returns the reference count of this resource.
      • Methods inherited from class java.lang.Object

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

      • AbstractResource

        protected AbstractResource()
    • Method Detail

      • retainCount

        public final int retainCount()

        Returns the reference count of this resource. This typically has no value for other than single-threaded unit- tests, as it is merely a snapshot of the counter.

        Returns:
        The current value of the reference counter.
      • destroy

        protected void destroy()

        This method signals that this AbstractResource can dispose of any internal resources, and commence with shut down of any internal threads. This will be called once the reference count of this resource reaches zero.

      • currentState

        public java.lang.String currentState()
        Returns a string describing the current state of references in human-friendly terms. May be used for debugging.