com.solarmetric.kodo.util
Class ProxyProperties
java.lang.Object
|
+--java.util.Dictionary
|
+--java.util.Hashtable
|
+--java.util.Properties
|
+--com.solarmetric.kodo.util.ProxyProperties
- All Implemented Interfaces:
- Cloneable, Map, Proxy, ProxyMap, Serializable
- public class ProxyProperties
- extends Properties
- implements ProxyMap
Extension of the Properties type that dirties the
persistent/transactional field it is assigned to on modification.
The need to dirty the field on any modification mandates that
this class must override all mutator methods of the base type.
This may lead to multiple calls to the
PersistenceCapable.jdoMakeDirty(java.lang.String) for one state
change if one mutator method of the base type calls another.
There is no change tracking logic in properties because it is
difficult to determine what to do when Properties.load(java.io.InputStream) is
called; some implementations might not delegate to the Map.put(java.lang.Object, java.lang.Object)
or Properties.setProperty(java.lang.String, java.lang.String) methods when loading.
- See Also:
- Serialized Form
| Methods inherited from class java.util.Hashtable |
clone, contains, containsKey, containsValue, elements, equals, get, hashCode, isEmpty, keys, rehash, size, toString |
ProxyProperties
public ProxyProperties()
- Template constructor.
ProxyProperties
public ProxyProperties(Class keyType,
Class valueType)
- Constructor.
- Parameters:
keyType - All keys in this map must be instances
of this type.valueType - All values in this map must be instances
of this type.
newInstance
public ProxyMap newInstance(Class keyType,
Class valueType,
Map contents,
Comparator compare)
- Description copied from interface:
ProxyMap
- This method should return a new proxy of the same
concrete type as the implementing class.
Used by the
ProxyManager factories: one template
instance of each type is created for the purpose of producing
new instances via this method. Overcomes the performance
penalties of reflection.
- Specified by:
newInstance in interface ProxyMap
getCopy
public Map getCopy(Map orig)
- Description copied from interface:
ProxyMap
- This method should return a copy of the given map; the copy
should be of the same class as the superclass of this collection.
- Specified by:
getCopy in interface ProxyMap
getComparator
public Comparator getComparator()
- Description copied from interface:
ProxyMap
- Return the comparator used in this map, or null if it is unordered or
uses natural ordering.
- Specified by:
getComparator in interface ProxyMap
setOwner
public void setOwner(Object pc,
String fieldName)
- Description copied from interface:
Proxy
- Set the owning JDO instance of the proxy and the name of the field it
is assigned to. Set to null to indicate that the proxy is
no longer managed.
- Specified by:
setOwner in interface Proxy
getOwner
public Object getOwner()
- Description copied from interface:
Proxy
- Return the owning object.
- Specified by:
getOwner in interface Proxy
getOwnerFieldName
public String getOwnerFieldName()
- Description copied from interface:
Proxy
- Return the owning field name.
- Specified by:
getOwnerFieldName in interface Proxy
clear
public void clear()
- Specified by:
clear in interface Map- Overrides:
clear in class Hashtable
keySet
public Set keySet()
- Specified by:
keySet in interface Map- Overrides:
keySet in class Hashtable
values
public Collection values()
- Specified by:
values in interface Map- Overrides:
values in class Hashtable
entrySet
public Set entrySet()
- Specified by:
entrySet in interface Map- Overrides:
entrySet in class Hashtable
put
public Object put(Object key,
Object value)
- Specified by:
put in interface Map- Overrides:
put in class Hashtable
putAll
public void putAll(Map m)
- Specified by:
putAll in interface Map- Overrides:
putAll in class Hashtable
remove
public Object remove(Object key)
- Specified by:
remove in interface Map- Overrides:
remove in class Hashtable
setProperty
public Object setProperty(String key,
String value)
- Overrides:
setProperty in class Properties
load
public void load(InputStream in)
throws IOException
- Overrides:
load in class Properties
writeReplace
protected Object writeReplace()
throws ObjectStreamException
Copyright 2001,2002 SolarMetric, Inc. All Rights Reserved.