org.apache.openjpa.util
Class ProxyManagerImpl

java.lang.Object
  extended by org.apache.openjpa.util.ProxyManagerImpl
All Implemented Interfaces:
Configurable, ProxyManager

public class ProxyManagerImpl
extends Object
implements ProxyManager, Configurable

Default implementation of the ProxyManager interface.

Author:
Abe White

Field Summary
protected  OpenJPAConfiguration conf
           
 
Constructor Summary
ProxyManagerImpl()
           
 
Method Summary
 Object copyArray(Object orig)
          Return a new array of the same component type as the given array and containing the same elements.
 Calendar copyCalendar(Calendar orig)
          Return a copy of the given Calendar with the same information.
 Collection copyCollection(Collection orig)
          Return a new collection of the same type as the given one with a copy of all contained elements.
 Object copyCustom(Object orig)
          Return a copy of the given object with the same information.
 Date copyDate(Date orig)
          Return a copy of the given date with the same information.
 Map copyMap(Map orig)
          Return a new map of the same type as the given one with a copy of all contained key/value pairs.
 void endConfiguration()
          Invoked upon completion of bean property configuration for this object.
 boolean getAssertAllowedType()
          Whether to perform runtime checks to ensure that all elements added to collection and map proxies are the proper element/key/value type as defined by the metadata.
 boolean getTrackChanges()
          Whether proxies produced by this factory will use ChangeTrackers to try to cut down on data store operations at the cost of some extra bookkeeping overhead.
 Proxy newCalendarProxy(Class type, TimeZone timeZone)
          Return a new calendar proxy.
 Proxy newCollectionProxy(Class type, Class elementType, Comparator compare)
          Return a proxy for the given collection type.
 Proxy newCustomProxy(Object obj)
          Return a proxy for the given object, or null if this manager cannot proxy the object.
 Proxy newDateProxy(Class type)
          Return a new date proxy.
 Proxy newMapProxy(Class type, Class keyType, Class valueType, Comparator compare)
          Return a proxy for the given map type.
 void setAssertAllowedType(boolean assertType)
          Whether to perform runtime checks to ensure that all elements added to collection and map proxies are the proper element/key/value type as defined by the metadata.
 void setConfiguration(Configuration conf)
          Invoked prior to setting bean properties.
protected  void setProxyTemplate(Class collType, ProxyCollection proxy)
          Add a supported proxy collection type.
protected  void setProxyTemplate(Class mapType, ProxyMap proxy)
          Add a supported proxy map type.
 void setTrackChanges(boolean track)
          Whether proxies produced by this factory will use ChangeTrackers to try to cut down on data store operations at the cost of some extra bookkeeping overhead.
 void startConfiguration()
          Invoked before bean property configuration is begun on this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

conf

protected OpenJPAConfiguration conf
Constructor Detail

ProxyManagerImpl

public ProxyManagerImpl()
Method Detail

getTrackChanges

public boolean getTrackChanges()
Whether proxies produced by this factory will use ChangeTrackers to try to cut down on data store operations at the cost of some extra bookkeeping overhead. Defaults to true.


setTrackChanges

public void setTrackChanges(boolean track)
Whether proxies produced by this factory will use ChangeTrackers to try to cut down on data store operations at the cost of some extra bookkeeping overhead. Defaults to true.


getAssertAllowedType

public boolean getAssertAllowedType()
Whether to perform runtime checks to ensure that all elements added to collection and map proxies are the proper element/key/value type as defined by the metadata. Defaults to false.


setAssertAllowedType

public void setAssertAllowedType(boolean assertType)
Whether to perform runtime checks to ensure that all elements added to collection and map proxies are the proper element/key/value type as defined by the metadata. Defaults to false.


copyDate

public Date copyDate(Date orig)
Description copied from interface: ProxyManager
Return a copy of the given date with the same information.

Specified by:
copyDate in interface ProxyManager

copyCalendar

public Calendar copyCalendar(Calendar orig)
Description copied from interface: ProxyManager
Return a copy of the given Calendar with the same information.

Specified by:
copyCalendar in interface ProxyManager

copyCollection

public Collection copyCollection(Collection orig)
Description copied from interface: ProxyManager
Return a new collection of the same type as the given one with a copy of all contained elements. If the given owner is non-null, the returned value should be a proxy for the given owner, otherwise it should not be a proxy.

Specified by:
copyCollection in interface ProxyManager

copyMap

public Map copyMap(Map orig)
Description copied from interface: ProxyManager
Return a new map of the same type as the given one with a copy of all contained key/value pairs. If the given owner is non-null, the returned value should be a proxy for the given owner, otherwise it should not be a proxy.

Specified by:
copyMap in interface ProxyManager

copyArray

public Object copyArray(Object orig)
Description copied from interface: ProxyManager
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.

Specified by:
copyArray in interface ProxyManager

copyCustom

public Object copyCustom(Object orig)
Description copied from interface: ProxyManager
Return a copy of the given object with the same information. If this manager cannot proxy the given type, return null. If the given owner is non-null, the returned value should be a proxy for the given owner, otherwise it should not be a proxy.

Specified by:
copyCustom in interface ProxyManager

newDateProxy

public Proxy newDateProxy(Class type)
Description copied from interface: ProxyManager
Return a new date proxy.

Specified by:
newDateProxy in interface ProxyManager

newCalendarProxy

public Proxy newCalendarProxy(Class type,
                              TimeZone timeZone)
Description copied from interface: ProxyManager
Return a new calendar proxy.

Specified by:
newCalendarProxy in interface ProxyManager

newCollectionProxy

public Proxy newCollectionProxy(Class type,
                                Class elementType,
                                Comparator compare)
Description copied from interface: ProxyManager
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.

Specified by:
newCollectionProxy in interface ProxyManager

newMapProxy

public Proxy newMapProxy(Class type,
                         Class keyType,
                         Class valueType,
                         Comparator compare)
Description copied from interface: ProxyManager
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.

Specified by:
newMapProxy in interface ProxyManager

newCustomProxy

public Proxy newCustomProxy(Object obj)
Description copied from interface: ProxyManager
Return a proxy for the given object, or null if this manager cannot proxy the object.

Specified by:
newCustomProxy in interface ProxyManager

setProxyTemplate

protected void setProxyTemplate(Class collType,
                                ProxyCollection proxy)
Add a supported proxy collection type.


setProxyTemplate

protected void setProxyTemplate(Class mapType,
                                ProxyMap proxy)
Add a supported proxy map type.


setConfiguration

public void setConfiguration(Configuration conf)
Description copied from interface: Configurable
Invoked prior to setting bean properties.

Specified by:
setConfiguration in interface Configurable

startConfiguration

public void startConfiguration()
Description copied from interface: Configurable
Invoked before bean property configuration is begun on this object.

Specified by:
startConfiguration in interface Configurable

endConfiguration

public void endConfiguration()
Description copied from interface: Configurable
Invoked upon completion of bean property configuration for this object.

Specified by:
endConfiguration in interface Configurable


Copyright © 2006 Apache Software Foundation. All Rights Reserved.