java.lang.Object
org.glassfish.hk2.configuration.persistence.properties.internal.PropertyFileHandleImpl
All Implemented Interfaces:
PropertyFileHandle

@Service public class PropertyFileHandleImpl extends Object implements PropertyFileHandle
Author:
jwells
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Will remove any instances added by this handle from the hub, and make it such that this handle can no longer be used
    Gets the default instance name that will be given to instances whose name cannot otherwise be determined
    Returns the default type name if the type cannot be determined from the key of the property.
    Returns the specific type associated with this handle
    void
    Reads the file associated with this handle and will do the following: Add any type found not previously added by this handle Add any instance found not previously added by this handle Modify any property that has changed value Remove any instance no longer seen in the file but that had previously been added In particular this method will NOT remove a type that was previously added but which has no more instances (other files may be contributing to the same type).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • readProperties

      public void readProperties(Properties properties)
      Description copied from interface: PropertyFileHandle
      Reads the file associated with this handle and will do the following:
      • Add any type found not previously added by this handle
      • Add any instance found not previously added by this handle
      • Modify any property that has changed value
      • Remove any instance no longer seen in the file but that had previously been added
        • In particular this method will NOT remove a type that was previously added but which has no more instances (other files may be contributing to the same type). After reaching the end of the input stream this method will close it
      Specified by:
      readProperties in interface PropertyFileHandle
      Parameters:
      properties - The properties object to inspect. May not be null
    • getSpecificType

      public String getSpecificType()
      Description copied from interface: PropertyFileHandle
      Returns the specific type associated with this handle
      Specified by:
      getSpecificType in interface PropertyFileHandle
      Returns:
      The specific type this handle is updating. May return null if this is a multi-type handle
    • getDefaultType

      public String getDefaultType()
      Description copied from interface: PropertyFileHandle
      Returns the default type name if the type cannot be determined from the key of the property. Will return null if getSpecificType is not null
      Specified by:
      getDefaultType in interface PropertyFileHandle
      Returns:
      The default type name if the type cannot be determined, or null if this handle has a specific type
    • getDefaultInstanceName

      public String getDefaultInstanceName()
      Description copied from interface: PropertyFileHandle
      Gets the default instance name that will be given to instances whose name cannot otherwise be determined
      Specified by:
      getDefaultInstanceName in interface PropertyFileHandle
      Returns:
      The default instance name. Will not return null
    • dispose

      public void dispose()
      Description copied from interface: PropertyFileHandle
      Will remove any instances added by this handle from the hub, and make it such that this handle can no longer be used
      Specified by:
      dispose in interface PropertyFileHandle