|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.openjpa.util.ProxyManagerImpl
public class ProxyManagerImpl
Default implementation of the ProxyManager interface.
| Constructor Summary | |
|---|---|
ProxyManagerImpl()
|
|
| Method Summary | |
|---|---|
protected boolean |
allowsDuplicates(Class type)
Return whether the given collection type allows duplicates. |
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, or null if this manager cannot copy the object. |
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. |
protected Constructor |
findCopyConstructor(Class cls)
Find an appropriate copy constructor for the given type, or return null if none. |
protected Method |
findGetter(Class type,
Method setter)
Return the getter corresponding to the given setter, or null. |
protected serp.bytecode.BCClass |
generateProxyBeanBytecode(Class type,
boolean runtime)
Generate the bytecode for a bean proxy for the given type. |
protected serp.bytecode.BCClass |
generateProxyCalendarBytecode(Class type,
boolean runtime)
Generate the bytecode for a calendar proxy for the given type. |
protected serp.bytecode.BCClass |
generateProxyCollectionBytecode(Class type,
boolean runtime)
Generate the bytecode for a collection proxy for the given type. |
protected serp.bytecode.BCClass |
generateProxyDateBytecode(Class type,
boolean runtime)
Generate the bytecode for a date proxy for the given type. |
protected serp.bytecode.BCClass |
generateProxyMapBytecode(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. |
Collection |
getUnproxyable()
Return a mutable view of class names we know cannot be proxied correctly by this manager. |
protected boolean |
isOrdered(Class type)
Return whether the given collection type maintains an artificial ordering. |
protected boolean |
isSetter(Method meth)
Return whether the given method is a setter. |
protected boolean |
isUnproxyable(Class type)
Return whether the given type is known to be unproxyable. |
protected Class |
loadBuildTimeProxy(Class type,
ClassLoader loader)
Load the proxy class generated at build time for the given type, returning null if none exists. |
protected Class<?> |
loadDelayedProxy(Class<?> type)
|
static void |
main(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(Class type,
TimeZone zone)
Return a new calendar proxy. |
Proxy |
newCollectionProxy(Class type,
Class elementType,
Comparator compare,
boolean autoOff)
Return a proxy for the given collection type. |
Proxy |
newCustomProxy(Object orig,
boolean autoOff)
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 elementType,
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(String clsNames)
Provided for auto-configuration. |
protected Class |
toProxyableCollectionType(Class type)
Return the concrete type for proxying. |
protected Class |
toProxyableMapType(Class type)
Return the concrete type for proxying. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ProxyManagerImpl()
| Method Detail |
|---|
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 Collection getUnproxyable()
public void setUnproxyable(String clsNames)
public Object copyArray(Object orig)
ProxyManager
copyArray in interface ProxyManagerpublic Collection copyCollection(Collection orig)
ProxyManager
copyCollection in interface ProxyManager
public Proxy newCollectionProxy(Class type,
Class elementType,
Comparator compare,
boolean autoOff)
ProxyManager
newCollectionProxy in interface ProxyManagerpublic Map copyMap(Map orig)
ProxyManager
copyMap in interface ProxyManager
public Proxy newMapProxy(Class type,
Class keyType,
Class elementType,
Comparator compare,
boolean autoOff)
ProxyManager
newMapProxy in interface ProxyManagerpublic Date copyDate(Date orig)
ProxyManager
copyDate in interface ProxyManagerpublic Proxy newDateProxy(Class type)
ProxyManager
newDateProxy in interface ProxyManagerpublic Calendar copyCalendar(Calendar orig)
ProxyManager
copyCalendar in interface ProxyManager
public Proxy newCalendarProxy(Class type,
TimeZone zone)
ProxyManager
newCalendarProxy in interface ProxyManagerpublic Object copyCustom(Object orig)
ProxyManager
copyCustom in interface ProxyManager
public Proxy newCustomProxy(Object orig,
boolean autoOff)
ProxyManager
newCustomProxy in interface ProxyManagerprotected Class toProxyableCollectionType(Class type)
protected Class toProxyableMapType(Class type)
protected boolean isUnproxyable(Class type)
protected Class loadBuildTimeProxy(Class type,
ClassLoader loader)
protected Class<?> loadDelayedProxy(Class<?> type)
protected serp.bytecode.BCClass generateProxyCollectionBytecode(Class type,
boolean runtime)
protected serp.bytecode.BCClass generateProxyMapBytecode(Class type,
boolean runtime)
protected serp.bytecode.BCClass generateProxyDateBytecode(Class type,
boolean runtime)
protected serp.bytecode.BCClass generateProxyCalendarBytecode(Class type,
boolean runtime)
protected serp.bytecode.BCClass generateProxyBeanBytecode(Class type,
boolean runtime)
protected boolean allowsDuplicates(Class type)
protected boolean isOrdered(Class type)
protected boolean isSetter(Method meth)
protected Method findGetter(Class type,
Method setter)
protected Constructor findCopyConstructor(Class cls)
public static void main(String[] args)
throws ClassNotFoundException,
IOException
ClassNotFoundException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||