public class ProxyManagerImpl extends java.lang.Object implements ProxyManager
ProxyManager interface.| Constructor and Description |
|---|
ProxyManagerImpl() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
allowsDuplicates(java.lang.Class type)
Return whether the given collection type allows duplicates.
|
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.
|
protected java.lang.reflect.Constructor |
findCopyConstructor(java.lang.Class cls)
Find an appropriate copy constructor for the given type, or return null
if none.
|
protected java.lang.reflect.Method |
findGetter(java.lang.Class type,
java.lang.reflect.Method setter)
Return the getter corresponding to the given setter, or null.
|
protected serp.bytecode.BCClass |
generateProxyBeanBytecode(java.lang.Class type,
boolean runtime)
Generate the bytecode for a bean proxy for the given type.
|
protected serp.bytecode.BCClass |
generateProxyCalendarBytecode(java.lang.Class type,
boolean runtime)
Generate the bytecode for a calendar proxy for the given type.
|
protected serp.bytecode.BCClass |
generateProxyCollectionBytecode(java.lang.Class type,
boolean runtime)
Generate the bytecode for a collection proxy for the given type.
|
protected serp.bytecode.BCClass |
generateProxyDateBytecode(java.lang.Class type,
boolean runtime)
Generate the bytecode for a date proxy for the given type.
|
protected serp.bytecode.BCClass |
generateProxyMapBytecode(java.lang.Class type,
boolean runtime)
Generate the bytecode for a map proxy for the given type.
|
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 |
getDelayCollectionLoading()
Whether loading of collections should be delayed until an operation
is performed that requires them to be loaded.
|
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. |
java.util.Collection |
getUnproxyable()
Return a mutable view of class names we know cannot be proxied
correctly by this manager.
|
protected boolean |
isOrdered(java.lang.Class type)
Return whether the given collection type maintains an artificial
ordering.
|
protected boolean |
isSetter(java.lang.reflect.Method meth)
Return whether the given method is a setter.
|
protected boolean |
isUnproxyable(java.lang.Class type)
Return whether the given type is known to be unproxyable.
|
protected java.lang.Class |
loadBuildTimeProxy(java.lang.Class type,
java.lang.ClassLoader loader)
Load the proxy class generated at build time for the given type,
returning null if none exists.
|
protected java.lang.Class<?> |
loadDelayedProxy(java.lang.Class<?> type) |
static void |
main(java.lang.String[] args)
Usage: java org.apache.openjpa.util.proxy.ProxyManagerImpl [option]*
<class name>+
Where the following options are recognized: -utils/-u <number>: Generate proxies for the standard java.util collection, map, date, and calendar classes of the given Java version. |
Proxy |
newCalendarProxy(java.lang.Class type,
java.util.TimeZone zone)
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 orig,
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 elementType,
java.util.Comparator compare,
boolean autoOff)
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 |
setDelayCollectionLoading(boolean delay)
Whether loading of collections should be delayed until an operation
is performed that requires them to be loaded.
|
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 |
setUnproxyable(java.lang.String clsNames)
Provided for auto-configuration.
|
protected java.lang.Class |
toProxyableCollectionType(java.lang.Class type)
Return the concrete type for proxying.
|
protected java.lang.Class |
toProxyableMapType(java.lang.Class type)
Return the concrete type for proxying.
|
public boolean getTrackChanges()
ChangeTrackers
to try to cut down on data store operations at the cost of some extra
bookkeeping overhead. Defaults to true.public void setTrackChanges(boolean track)
ChangeTrackers
to try to cut down on data store operations at the cost of some extra
bookkeeping overhead. Defaults to true.public boolean getAssertAllowedType()
public void setAssertAllowedType(boolean assertType)
public boolean getDelayCollectionLoading()
getDelayCollectionLoading in interface ProxyManagerpublic void setDelayCollectionLoading(boolean delay)
public java.util.Collection getUnproxyable()
public void setUnproxyable(java.lang.String clsNames)
public java.lang.Object copyArray(java.lang.Object orig)
ProxyManagercopyArray in interface ProxyManagerpublic java.util.Collection copyCollection(java.util.Collection orig)
ProxyManagercopyCollection in interface ProxyManagerpublic Proxy newCollectionProxy(java.lang.Class type, java.lang.Class elementType, java.util.Comparator compare, boolean autoOff)
ProxyManagernewCollectionProxy in interface ProxyManagerpublic java.util.Map copyMap(java.util.Map orig)
ProxyManagercopyMap in interface ProxyManagerpublic Proxy newMapProxy(java.lang.Class type, java.lang.Class keyType, java.lang.Class elementType, java.util.Comparator compare, boolean autoOff)
ProxyManagernewMapProxy in interface ProxyManagerpublic java.util.Date copyDate(java.util.Date orig)
ProxyManagercopyDate in interface ProxyManagerpublic Proxy newDateProxy(java.lang.Class type)
ProxyManagernewDateProxy in interface ProxyManagerpublic java.util.Calendar copyCalendar(java.util.Calendar orig)
ProxyManagercopyCalendar in interface ProxyManagerpublic Proxy newCalendarProxy(java.lang.Class type, java.util.TimeZone zone)
ProxyManagernewCalendarProxy in interface ProxyManagerpublic java.lang.Object copyCustom(java.lang.Object orig)
ProxyManagercopyCustom in interface ProxyManagerpublic Proxy newCustomProxy(java.lang.Object orig, boolean autoOff)
ProxyManagernewCustomProxy in interface ProxyManagerprotected java.lang.Class toProxyableCollectionType(java.lang.Class type)
protected java.lang.Class toProxyableMapType(java.lang.Class type)
protected boolean isUnproxyable(java.lang.Class type)
protected java.lang.Class loadBuildTimeProxy(java.lang.Class type,
java.lang.ClassLoader loader)
protected java.lang.Class<?> loadDelayedProxy(java.lang.Class<?> type)
protected serp.bytecode.BCClass generateProxyCollectionBytecode(java.lang.Class type,
boolean runtime)
protected serp.bytecode.BCClass generateProxyMapBytecode(java.lang.Class type,
boolean runtime)
protected serp.bytecode.BCClass generateProxyDateBytecode(java.lang.Class type,
boolean runtime)
protected serp.bytecode.BCClass generateProxyCalendarBytecode(java.lang.Class type,
boolean runtime)
protected serp.bytecode.BCClass generateProxyBeanBytecode(java.lang.Class type,
boolean runtime)
protected boolean allowsDuplicates(java.lang.Class type)
protected boolean isOrdered(java.lang.Class type)
protected boolean isSetter(java.lang.reflect.Method meth)
protected java.lang.reflect.Method findGetter(java.lang.Class type,
java.lang.reflect.Method setter)
protected java.lang.reflect.Constructor findCopyConstructor(java.lang.Class cls)
public static void main(java.lang.String[] args)
throws java.lang.ClassNotFoundException,
java.io.IOException
java.lang.ClassNotFoundExceptionjava.io.IOExceptionCopyright © 2006-2013 Apache Software Foundation. All Rights Reserved.