Package org.apache.jcs.auxiliary

Examples of org.apache.jcs.auxiliary.AuxiliaryCacheFactory


                                             String regName )
    {
        AuxiliaryCache auxCache;

        // GET FACTORY
        AuxiliaryCacheFactory auxFac = ccMgr.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 );
            ccMgr.registryFacPut( auxFac );
        }

        // GET ATTRIBUTES
        AuxiliaryCacheAttributes auxAttr = ccMgr.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 );
            ccMgr.registryAttrPut( auxAttr );
        }

        auxAttr = auxAttr.copy();

        log.debug( "Parsing options for '" + attrName + "'" );
        PropertySetter.setProperties( auxAttr, props, attrName + "." );
        auxAttr.setCacheName( regName );

        log.debug( "End of parsing for '" + attrName + "'" );

        // GET CACHE FROM FACTORY WITH ATTRIBUTES
        auxAttr.setCacheName( regName );
        auxCache = auxFac.createCache( auxAttr );
        return auxCache;
    }
View Full Code Here


            // 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;
    }
View Full Code Here

TOP

Related Classes of org.apache.jcs.auxiliary.AuxiliaryCacheFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.