|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.portal.pcm.events.AbstractCachingMapperFactory
public abstract class AbstractCachingMapperFactory
Abstract implementation of a caching MapperFactory
.
Constructor Summary | |
---|---|
AbstractCachingMapperFactory()
Construct a AbstractCachingMapperFactory. |
Method Summary | ||
---|---|---|
ContextToPayloadMapper |
getContextToPayloadMapper(java.lang.String classname)
Returns an instance of the implementation of the specified ContextToPayloadMapper. |
|
protected
|
getObjectInstance(java.lang.String classname,
java.lang.Class<T> type)
Tries to creates a object of the given name. |
|
PayloadToContextMapper |
getPayloadToContextMapper(java.lang.String classname)
Returns an instance of the implementation of the specified PayloadToContextMapper. |
|
protected abstract java.util.Collection<java.lang.ClassLoader> |
initClassloaders()
Returns a list of classloaders to be used by this MapperFactory. |
|
protected void |
internalClearCache()
Clears the cache. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractCachingMapperFactory() throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
- if the subclass-supplied method initClassloaders()
returns invalid
results.Method Detail |
---|
protected final void internalClearCache()
protected abstract java.util.Collection<java.lang.ClassLoader> initClassloaders()
If the returned list
null
null
-entry
IllegalArgumentException
.
The simplest implementation is:
protected Collection<ClassLoader> initClassloaders() { return Collections.singleton(this.getClass().getClassloader()); }
public final PayloadToContextMapper getPayloadToContextMapper(java.lang.String classname)
MapperFactory
Must not throw an exception if the named class could not be found, instantiated or is of an invalid type. In this
cases null
must be returned.
If the class was found but could not be instantiated or is of an invalid type, this should be logged.
getPayloadToContextMapper
in interface MapperFactory
classname
- Name of the instance to instantiate.
PayloadToContextMapper
instance associated to given name or null
if an instance could
not be created.public final ContextToPayloadMapper getContextToPayloadMapper(java.lang.String classname)
MapperFactory
Must not throw an exception if the named class could not be found, instantiated or is of an invalid type. In this
cases null
must be returned.
If the class was found but could not be instantiated or is of an invalid type, this should be logged.
getContextToPayloadMapper
in interface MapperFactory
classname
- Name of the instance to instantiate.
ContextToPayloadMapper
instance associated with the given name or null
if an instance
could not be created.protected final <T> T getObjectInstance(java.lang.String classname, java.lang.Class<T> type)
initClassloaders()
during construction of the object. If the class can't be loaded or can't be
instantiated, null
is returned.
classname
- The type of object to instantiate.type
- the created object must be assignable to this type.
null
if the class could not be found or loaded.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |