Interface ProxyManager

  • All Known Implementing Classes:
    ProxyManagerImpl

    public interface ProxyManager
    Manager for copying and proxying second class objects. Second class objects are those that are often used as fields of persistent or transactional instances, and which can themselves be modified without resetting the owning class' field. Because these types can change without an explicit call to the owning persistence capable instance, special care must be taken to ensure that their state is managed correctly. Specifically, they must be copied when saving state for rollback, and they must be proxied for any instance whose state is managed by a state manager, where proxying involves creating a second class object that automaticlly notifies its owning instance whenever it is modified. Generally, this factory is only used by the implementation; second class object handling is transparent to client code.
    Author:
    Abe White
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.Object copyArray​(java.lang.Object orig)
      Return a new array of the same component type as the given array and containing the same elements.
      java.util.Calendar copyCalendar​(java.util.Calendar orig)
      Return a copy of the given calendar with the same information.
      java.util.Collection copyCollection​(java.util.Collection orig)
      Return a new collection of the same type as the given one with a copy of all contained elements.
      java.lang.Object copyCustom​(java.lang.Object orig)
      Return a copy of the given object with the same information, or null if this manager cannot copy the object.
      java.util.Date copyDate​(java.util.Date orig)
      Return a copy of the given date with the same information.
      java.util.Map copyMap​(java.util.Map orig)
      Return a new map of the same type as the given one with a copy of all contained key/value pairs.
      boolean getDelayCollectionLoading()
      Returns whether this proxy manager is enabled for delayed collection loading.
      Proxy newCalendarProxy​(java.lang.Class type, java.util.TimeZone timeZone)
      Return a new calendar proxy.
      Proxy newCollectionProxy​(java.lang.Class type, java.lang.Class elementType, java.util.Comparator compare, boolean autoOff)
      Return a proxy for the given collection type.
      Proxy newCustomProxy​(java.lang.Object obj, boolean autoOff)
      Return a proxy for the given object, or null if this manager cannot proxy the object.
      Proxy newDateProxy​(java.lang.Class type)
      Return a new date proxy.
      Proxy newMapProxy​(java.lang.Class type, java.lang.Class keyType, java.lang.Class valueType, java.util.Comparator compare, boolean autoOff)
      Return a proxy for the given map type.
    • Method Detail

      • copyArray

        java.lang.Object copyArray​(java.lang.Object orig)
        Return a new array of the same component type as the given array and containing the same elements. Works for both primitive and object array types.
      • copyDate

        java.util.Date copyDate​(java.util.Date orig)
        Return a copy of the given date with the same information.
      • newDateProxy

        Proxy newDateProxy​(java.lang.Class type)
        Return a new date proxy.
      • copyCalendar

        java.util.Calendar copyCalendar​(java.util.Calendar orig)
        Return a copy of the given calendar with the same information.
      • newCalendarProxy

        Proxy newCalendarProxy​(java.lang.Class type,
                               java.util.TimeZone timeZone)
        Return a new calendar proxy.
      • copyCollection

        java.util.Collection copyCollection​(java.util.Collection orig)
        Return a new collection of the same type as the given one with a copy of all contained elements.
      • newCollectionProxy

        Proxy newCollectionProxy​(java.lang.Class type,
                                 java.lang.Class elementType,
                                 java.util.Comparator compare,
                                 boolean autoOff)
        Return a proxy for the given collection type. The returned collection will allow only addition of elements assignable from the given element type and will use the given comparator, if it is not null.
      • copyMap

        java.util.Map copyMap​(java.util.Map orig)
        Return a new map of the same type as the given one with a copy of all contained key/value pairs.
      • newMapProxy

        Proxy newMapProxy​(java.lang.Class type,
                          java.lang.Class keyType,
                          java.lang.Class valueType,
                          java.util.Comparator compare,
                          boolean autoOff)
        Return a proxy for the given map type. The returned map will allow only addition of keys/values assignable from the given keyType/valueType, and will use the given comparator, if it is not null.
      • copyCustom

        java.lang.Object copyCustom​(java.lang.Object orig)
        Return a copy of the given object with the same information, or null if this manager cannot copy the object.
        Since:
        0.2.5
      • newCustomProxy

        Proxy newCustomProxy​(java.lang.Object obj,
                             boolean autoOff)
        Return a proxy for the given object, or null if this manager cannot proxy the object.
        Since:
        0.2.5
      • getDelayCollectionLoading

        boolean getDelayCollectionLoading()
        Returns whether this proxy manager is enabled for delayed collection loading. Delayed collection loading provides the ability to do simple, non-indexed add or remove operations on a lazy collection without loading the collection. The collection is loaded when necessary, such as iteration, indexed operations, isEmpty, or size.
        Since:
        2.2.1