Package com.sun.enterprise.deployment.runtime.web

Examples of com.sun.enterprise.deployment.runtime.web.CacheHelper


        }
        manager.setDefaultHelperProps(map);

        // configure custom cache-helper classes
        for (int i = 0; i < cacheConfig.sizeCacheHelper(); i++) {
            CacheHelper helperConfig = cacheConfig.getCacheHelper(i);

            String helperName = helperConfig.getAttributeValue(
                CacheHelper.NAME);
            HashMap helperProps = new HashMap();
            props = helperConfig.getWebProperty();
            for (int j = 0; j < props.length; j++) {
                name = props[i].getAttributeValue(WebProperty.NAME);
                value = props[i].getAttributeValue(WebProperty.VALUE);

                helperProps.put(name, value);
            }
            helperProps.put("class-name",
                            helperConfig.getAttributeValue(
                            CacheHelper.CLASS_NAME));

            manager.addCacheHelperDef(helperName, helperProps);
        }
View Full Code Here


        boolean presentHelper=false;

        try{
            Cache cache = (descriptor.getSunDescriptor()).getCache();
            CacheHelper[] helperClasses=null;
            CacheHelper helperClass=null;
            WebProperty[] webProps;
            String name=null;
            String classname=null;
            String[] names=null;
            //to-do vkv# check for class-name attribute.
            if (cache != null )
                helperClasses=cache.getCacheHelper();
            if (cache != null && helperClasses !=null && helperClasses.length > 0)
            {
                names=new String[helperClasses.length];            
                for(int rep=0;rep < helperClasses.length;rep++)
                {
                    helperClass=helperClasses[rep];
                    if(helperClass==null)
                        continue;
                    int i = rep+1;
                    name = getXPathValue("sun-web-app/cache/cache-helper["+i+"]/@name");
                    classname = getXPathValue("sun-web-app/cache/cache-helper["+i+"]/@class-name");
                    Class hClass=null;
                    names[rep]=name;

                    if (name != null && name.length() != 0) {
                        //check if the name already exist
                        boolean isDuplicate=false;
                        for(int rep1=0;rep1<rep;rep1++)
                        {
                            if(name.equals(names[rep1]))
                            {
                                isDuplicate=true;
                                break;
                            }

                        }
                        if(isDuplicate)
                        {
                            oneFailed = true;
                            addErrorDetails(result, compName);
                            result.failed(smh.getLocalString
                                      (getClass().getName() + ".failed",
                                      "FAILED [AS-WEB cache-helper] name attribute [ {0} ], must be unique in the entire list of cache-helper.",
                                      new Object[] {name}));
                        }
                        else
                        {
                            if(classname!=null && classname.length()!=0) {
                                hClass = loadClass(result,classname);
                            }
                            if(hClass !=null)
                                presentHelper=true ;
                            else
                                presentHelper=false ;
                         
                            if(!presentHelper)
                            {
                                addWarningDetails(result, compName);
                                result.warning(smh.getLocalString(
                                                    getClass().getName() + ".error",
                                                    "WARNING [AS-WEB cache-helper] " +
                                                    "name [ {0} ], class not present in the war file.",
                                                    new Object[] {name}));
                                oneWarning = true;
                            }
                            else
                            {
                                addGoodDetails(result, compName);
                                result.passed(smh.getLocalString
            (getClass().getName() + ".passed",
             "PASSED [AS-WEB cache-helper] name  [ {0} ], helper class is valid.",
             new Object[] {name}));
                            }
                           
                        }
                    } else {
                        addErrorDetails(result, compName);
                        result.failed(smh.getLocalString
                                      (getClass().getName() + ".failed1",
                                      "FAILED [AS-WEB cache-helper] name [ {0} ], either empty or null.",
                                      new Object[] {name}));
            oneFailed = true;
                  
                    }
                    webProps=helperClass.getWebProperty();
                    if(ASWebProperty.checkWebProperties(webProps,result ,descriptor, this )){
                        oneFailed=true;
                        addErrorDetails(result, compName);
                        result.failed(smh.getLocalString
                                (getClass().getName() + ".failed2",
View Full Code Here

   
    boolean validCacheHelperRef(String helperRef, Cache cache){
          boolean valid=false;
          if (helperRef.length() != 0){
            CacheHelper[] helperClasses=null;
            CacheHelper helperClass=null;
            String name=null;
            if (cache != null ){
               helperClasses=cache.getCacheHelper();
            }
            if (cache != null && helperClasses !=null){
View Full Code Here

   
    boolean validCacheHelperRef(String helperRef, Cache cache){
          boolean valid=false;
          if (helperRef.length() != 0){
            CacheHelper[] helperClasses=null;
            CacheHelper helperClass=null;
            String name=null;
            if (cache != null ){
               helperClasses=cache.getCacheHelper();
            }
            if (cache != null && helperClasses !=null){
View Full Code Here

        boolean presentHelper=false;

        try{
            Cache cache = (descriptor.getSunDescriptor()).getCache();
            CacheHelper[] helperClasses=null;
            CacheHelper helperClass=null;
            WebProperty[] webProps;
            String name=null;
            String classname=null;
            String[] names=null;
            //to-do vkv# check for class-name attribute.
            if (cache != null )
                helperClasses=cache.getCacheHelper();
            if (cache != null && helperClasses !=null && helperClasses.length > 0)
            {
                names=new String[helperClasses.length];            
                for(int rep=0;rep < helperClasses.length;rep++)
                {
                    helperClass=helperClasses[rep];
                    if(helperClass==null)
                        continue;
                    int i = rep+1;
                    name = getXPathValue("sun-web-app/cache/cache-helper["+i+"]/@name");
                    classname = getXPathValue("sun-web-app/cache/cache-helper["+i+"]/@class-name");
                    Class hClass=null;
                    names[rep]=name;

                    if (name != null && name.length() != 0) {
                        //check if the name already exist
                        boolean isDuplicate=false;
                        for(int rep1=0;rep1<rep;rep1++)
                        {
                            if(name.equals(names[rep1]))
                            {
                                isDuplicate=true;
                                break;
                            }

                        }
                        if(isDuplicate)
                        {
                            oneFailed = true;
                            addErrorDetails(result, compName);
                            result.failed(smh.getLocalString
                                      (getClass().getName() + ".failed",
                                      "FAILED [AS-WEB cache-helper] name attribute [ {0} ], must be unique in the entire list of cache-helper.",
                                      new Object[] {name}));
                        }
                        else
                        {
                            if(classname!=null && classname.length()!=0) {
                                hClass = loadClass(result,classname);
                            }
                            if(hClass !=null)
                                presentHelper=true ;
                            else
                                presentHelper=false ;
                         
                            if(!presentHelper)
                            {
                                addWarningDetails(result, compName);
                                result.warning(smh.getLocalString(
                                                    getClass().getName() + ".error",
                                                    "WARNING [AS-WEB cache-helper] " +
                                                    "name [ {0} ], class not present in the war file.",
                                                    new Object[] {name}));
                                oneWarning = true;
                            }
                            else
                            {
                                addGoodDetails(result, compName);
                                result.passed(smh.getLocalString
            (getClass().getName() + ".passed",
             "PASSED [AS-WEB cache-helper] name  [ {0} ], helper class is valid.",
             new Object[] {name}));
                            }
                           
                        }
                    } else {
                        addErrorDetails(result, compName);
                        result.failed(smh.getLocalString
                                      (getClass().getName() + ".failed1",
                                      "FAILED [AS-WEB cache-helper] name [ {0} ], either empty or null.",
                                      new Object[] {name}));
            oneFailed = true;
                  
                    }
                    webProps=helperClass.getWebProperty();
                    if(ASWebProperty.checkWebProperties(webProps,result ,descriptor, this )){
                        oneFailed=true;
                        addErrorDetails(result, compName);
                        result.failed(smh.getLocalString
                                (getClass().getName() + ".failed2",
View Full Code Here

TOP

Related Classes of com.sun.enterprise.deployment.runtime.web.CacheHelper

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.