Overview | Package | Class | Tree | Serialized | Deprecated | Index | Help
| SolarMetric Kodo JDO 2.4.3 generated on March 27 2003
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.solarmetric.kodo.util
Interface ProxyManager

All Known Implementing Classes:
  SimpleProxyManager

public interface ProxyManager

Manager for copying and proxying second class objects. JDO considers second class objects to be 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 PersistenceCapable 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 StateManager, 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 JDO implementation; second class object handling is transparent to client code.

Method Summary
`Object` | `getArrayCopy(Object orig, Object owner, String field)` Return a new array of the same component type as the given array and containing the same elements.
`Collection` | `getCollectionCopy(Collection orig, Object owner, String field)` Return a new collection of the same type as the given one with a copy of all contained elements.
`ProxyCollection` | `getCollectionProxy(Class type, Class elementType, Collection contents, Comparator compare, Object owner, String field)` Return a proxy for the given collection type.
`Object` | `getCustomCopy(Object orig, Object owner, String field)` Return a copy of the given object with the same information.
`Object` | `getCustomProxy(Object orig, Object owner, String field)` Return a proxy for the given object.
`Date` | `getDateCopy(Date orig, Object owner, String field)` Return a copy of the given date with the same information.
`ProxyDate` | `getDateProxy(Date orig, Object owner, String field)` Return a proxy for the given date instance.
`Map` | `getMapCopy(Map orig, Object owner, String field)` Return a new map of the same type as the given one with a copy of all contained key/value pairs.
`ProxyMap` | `getMapProxy(Class type, Class keyType, Class valueType, Map contents, Comparator compare, Object owner, String field)` Return a proxy for the given map type.
`boolean` | `isCustomProxyType(Class cls)` Return `true` if `cls` is a type that is handled by `getCustomCopy(java.lang.Object, java.lang.Object, java.lang.String)` or `getCustomProxy(java.lang.Object, java.lang.Object, java.lang.String)`.

Method Detail

### isCustomProxyType

    public boolean isCustomProxyType(Class cls)

  Return `true` if `cls` is a type that is handled by `getCustomCopy(java.lang.Object, java.lang.Object, java.lang.String)` or `getCustomProxy(java.lang.Object, java.lang.Object, java.lang.String)`.

### getDateCopy

    public Date getDateCopy(Date orig,
                            Object owner,
                            String field)

  Return a copy of the given date with the same information. If the given date is proxied, the returned instance will be the correct non-proxied type.

### getCollectionCopy

    public Collection getCollectionCopy(Collection orig,
                                        Object owner,
                                        String field)

  Return a new collection of the same type as the given one with a copy of all contained elements. If the given type is a proxy type, the returned instance will be of the correct non-proxied type.

### getMapCopy

    public Map getMapCopy(Map orig,
                          Object owner,
                          String field)

  Return a new map of the same type as the given one with a copy of all contained key/value pairs. If the given type is a proxy type, the returned instance will be of the correct non-proxied type.

### getArrayCopy

    public Object getArrayCopy(Object orig,
                               Object owner,
                               String field)

  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.

### getCustomCopy

    public Object getCustomCopy(Object orig,
                                Object owner,
                                String field)

  Return a copy of the given object with the same information. If the given object is proxied, the returned instance will be the correct non-proxied type. This will only be invoked if `isCustomProxyType(java.lang.Class)` returns `true` when invoked with `orig`'s class.

### getDateProxy

    public ProxyDate getDateProxy(Date orig,
                                  Object owner,
                                  String field)

  Return a proxy for the given date instance. The owner of the proxy should be set to the given object and field.

### getCollectionProxy

    public ProxyCollection getCollectionProxy(Class type,
                                              Class elementType,
                                              Collection contents,
                                              Comparator compare,
                                              Object owner,
                                              String field)

  Return a proxy for the given collection type. The returned collection will allow only addition of elements assignable from the given element type, and can be configured to not allow the addition of null elements. The owner of the proxy should be set to the given object and field.

### getMapProxy

    public ProxyMap getMapProxy(Class type,
                                Class keyType,
                                Class valueType,
                                Map contents,
                                Comparator compare,
                                Object owner,
                                String field)

  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 can be configured to not allow the addition of null keys/elements. The owner of the proxy should be set to the given object and field.

### getCustomProxy

    public Object getCustomProxy(Object orig,
                                 Object owner,
                                 String field)

  Return a proxy for the given object. The owner of the proxy should be set to the given object and field. This will only be invoked if `isCustomProxyType(java.lang.Class)` returns `true` when invoked with `orig`'s class.

Overview | Package | Class | Tree | Serialized | Deprecated | Index | Help
| SolarMetric Kodo JDO 2.4.3 generated on March 27 2003
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright 2001,2002 SolarMetric, Inc. All Rights Reserved.