com.solarmetric.kodo.runtime
Class JDOClassResolver
java.lang.Object
|
+--com.solarmetric.kodo.runtime.JDOClassResolver
- All Implemented Interfaces:
- ClassResolver
- public class JDOClassResolver
- extends Object
- implements ClassResolver
An imeplementation of ClassResolver that behaves in
strict accordance to section 12.5 of the JDO specification:
JDO requires access to class instances in several situations where the
class instance is not provided explicitly. In these cases, the only
information available to the implementation is the name of the class.
To resolve class names to class instances, JDO implementations will use
Class.forName (String name, ClassLoader loader) with up to three loaders.
These loaders will be used in this order:
- The loader that loaded the class or instance referred to in the API
that caused this class to be loaded.
- The loader returned in the current context by
Thread.getContextClassLoader().
- The loader returned by Thread.getContextClassLoader() at the time
of PersistenceManagerFactory.getPersistenceManager(). This loader is
saved with the PersistenceManager and cleared when the
PersistenceManager is closed.
JDOClassResolver
JDOClassResolver(PersistenceManagerImpl pm,
ClassLoader cl)
resolveClass
public Class resolveClass(String className)
- Description copied from interface:
ClassResolver
- Resolve the class for the specified name.
- Specified by:
resolveClass in interface ClassResolver
- Following copied from interface:
com.solarmetric.util.classes.ClassResolver
- Parameters:
className - the specified name to load- Returns:
- the resolved class
- Throws:
JDOFatalUserException - if the class cannot be loaded.
resolveResource
public InputStream resolveResource(String resourceName)
- Specified by:
resolveResource in interface ClassResolver
canResolveClass
public boolean canResolveClass(String className)
- Specified by:
canResolveClass in interface ClassResolver
toString
public String toString()
- Overrides:
toString in class Object
equals
public boolean equals(Object other)
- Returns true if the two JDOClassResolvers use the same list
of
ClassLoaders, since they will resolve classes
in exactly the same way.
- Specified by:
equals in interface ClassResolver- Overrides:
equals in class Object
- Following copied from interface:
com.solarmetric.util.classes.ClassResolver
- See Also:
Object.equals(Object)
hashCode
public int hashCode()
- Description copied from interface:
ClassResolver
- This method must be overridden for the standard hashCode()
contract that is used when overriding the equals methos.
- Specified by:
hashCode in interface ClassResolver- Overrides:
hashCode in class Object
- Following copied from interface:
com.solarmetric.util.classes.ClassResolver
- See Also:
Object.hashCode()
Copyright 2001,2002,2003 SolarMetric, Inc. All Rights Reserved.