// TODO change method signature if is isn't needed.
log.debug( "parseAuxiliary, Cache = " + cache );
}
// GET FACTORY
AuxiliaryCacheFactory auxFac = compositeCacheManager.registryFacGet( auxName );
if ( auxFac == null )
{
// auxFactory was not previously initialized.
String prefix = AUXILIARY_PREFIX + auxName;
auxFac = (AuxiliaryCacheFactory) OptionConverter
.instantiateByKey( props, prefix, org.apache.jcs.auxiliary.AuxiliaryCacheFactory.class, null );
if ( auxFac == null )
{
log.error( "Could not instantiate auxFactory named \"" + auxName + "\"." );
return null;
}
auxFac.setName( auxName );
compositeCacheManager.registryFacPut( auxFac );
}
// GET ATTRIBUTES
AuxiliaryCacheAttributes auxAttr = compositeCacheManager.registryAttrGet( auxName );
String attrName = AUXILIARY_PREFIX + auxName + ATTRIBUTE_PREFIX;
if ( auxAttr == null )
{
// auxFactory was not previously initialized.
String prefix = AUXILIARY_PREFIX + auxName + ATTRIBUTE_PREFIX;
auxAttr = (AuxiliaryCacheAttributes) OptionConverter
.instantiateByKey( props, prefix, org.apache.jcs.auxiliary.AuxiliaryCacheAttributes.class, null );
if ( auxFac == null )
{
log.error( "Could not instantiate auxAttr named '" + attrName + "'" );
return null;
}
auxAttr.setName( auxName );
compositeCacheManager.registryAttrPut( auxAttr );
}
auxAttr = auxAttr.copy();
if ( log.isDebugEnabled() )
{
log.debug( "Parsing options for '" + attrName + "'" );
}
PropertySetter.setProperties( auxAttr, props, attrName + "." );
auxAttr.setCacheName( regName );
if ( log.isDebugEnabled() )
{
log.debug( "End of parsing for '" + attrName + "'" );
}
// GET CACHE FROM FACTORY WITH ATTRIBUTES
auxAttr.setCacheName( regName );
// Consider putting the compositeCache back in the factory interface
// since the manager may not know about it at this point.
// need to make sure the maanger already has the cache
// before the auxiliary is created.
auxCache = auxFac.createCache( auxAttr, compositeCacheManager );
return auxCache;
}