Package com.sun.enterprise.config

Examples of com.sun.enterprise.config.ConfigBean


       
        //************************************************
        //4. looks like new element. First, non-indexed
        if(!nextToken.endsWith("]"))
        {
            ConfigBean cbNext = getNextBean(cb, nextToken);
            if(cbNext!=null)
                navigate((ConfigBean)cbNext, tokens, iNextToken , prefixFilter, list);
            return;
        }
       
View Full Code Here


    {
        if(valCtx.choice == null)
            return;
        String attrName = attr.getName();
        Object value = null;
        ConfigBean ownerBean = null;
        if(valCtx.isADD() || valCtx.isVALIDATE() ||  valCtx.isSET() || valCtx.isDELETE())
        {
            ownerBean = (ConfigBean)valCtx.value;
            value = ((ConfigBean)valCtx.value).getAttributeValue(attrName);
           
View Full Code Here

    {
     String key = desc.getKey();
     String element = desc.getElementName();
     if(valCtx.isADD() || valCtx.isSET())
     {
        ConfigBean thisBean = (ConfigBean)valCtx.value;
        ConfigBean parentBean = (ConfigBean)valCtx.classObject;
        String[] names = desc.requiredChildren;
        for(int i=0; names!=null && i<names.length; i++)
        {
            String childName = names[i];
            if(names[i].endsWith("*"))
 
View Full Code Here

    // NOTE: ValidationContext is initialized in child's validator
    public void validateAsParent(ValidationContext valCtx)
    {
     if(valCtx.isADD() || valCtx.isSET())
     {
        ConfigBean newChildBean = (ConfigBean)valCtx.value;
        String newChildBeanName = getBeanElementName(newChildBean);
        ConfigBean parentBean = (ConfigBean)valCtx.classObject;

        String[] names = desc.exclusiveChildren;
        //first, let's be sure that newChildBean in exclusive list
        boolean bNewChildIsInList = false;
        if(names!=null)
        {
            for(int i=0; i<names.length; i++)
            {
               if(newChildBeanName.equals(names[i]))
               {
                   bNewChildIsInList = true;
                   break;
               }
            }
        }
        //now find out if any othjers are there too
        if(bNewChildIsInList)
        {
            for(int i=0; i<names.length; i++)
            {
                String childName = names[i];
                if(childName.equals(newChildBeanName))
                    continue;
                childName = XPathHelper.convertName(childName);
                ConfigBean[] beans = parentBean.getChildBeansByName(childName);
                if (beans!=null && beans.length>0)
                {
                    String printParentName = getConfigElementPrintName(
                        parentBean.getXPath(), false, false);
                    valCtx.result.failed(valCtx.smh.getLocalString(
                            GenericValidator.class.getName() + ".childrenCanExistTogether",
                            "{0} can not contain both sub-elements {1} and {2} in the same time.",
                            new Object[] {printParentName,
                                    newChildBeanName, names[i]}));
                }
            }
        }
     }
     else if(valCtx.isDELETE())
     {
        //Check for existence of required sub-elements
        ConfigBean childBean = (ConfigBean)valCtx.value;
        ConfigBean parentBean = (ConfigBean)valCtx.classObject;
        String childBeanName = XPathHelper.convertName(getBeanElementName(childBean));
        ConfigBean[] beans = parentBean.getChildBeansByName(childBeanName);
        if (beans!=null && beans.length==1)
        {  //LAST ELEM DELETION
            ValidationDescriptor parentDescr = desc;
            String[] names = null;
            if(parentDescr!=null)
                names = parentDescr.requiredChildren;
            String compareTo = getBeanElementName(childBean);
            String compareTo2 = compareTo+'*';
            for(int i=0; names!=null && i<names.length; i++)
            {
                if(compareTo.equals(names[i]))
                {
                    String printParentName = getConfigElementPrintName(
                        parentBean.getXPath(), false, false);
                    String printChildName = getConfigElementPrintName(
                        childBean.getXPath(), false, false);
                    valCtx.result.failed(valCtx.smh.getLocalString(
                        GenericValidator.class.getName() + ".requiredElemDelete",
                        "Required element {0} can not be deleted from {1}",
                        new Object[] {printChildName, printParentName}));
                    break;
                }
                else if(compareTo2.equals(names[i]))
                {
                    String printParentName = getConfigElementPrintName(
                        parentBean.getXPath(), false, false);
                    String printChildName = getConfigElementPrintName(
                        childBean.getXPath(), false, false);
                    valCtx.result.failed(valCtx.smh.getLocalString(
                        GenericValidator.class.getName() + ".lastRequiredElemDelete",
                        "At least one required {0} should be present in {1}."+
View Full Code Here

       
        //validate element (without attributes)
        validateElement(valCtx);
       
        //ask parent to confirm change  
        ConfigBean parentBean = valCtx.getParentBean();
        if(parentBean!=null)
        {
           //validate changes by Parent
           GenericValidator parentValidator =
                   desc.domainMgr.findConfigBeanValidator((ConfigBean)parentBean);
View Full Code Here

               getConfigElementPrintName(xpath, bIncludingKey, bReplaceRefByParentElem);
   }
    static String getTargetElementPrintName( ValidationContext valCtx,
            boolean bIncludingKey, boolean bReplaceRefByParentElem)
   {
        ConfigBean targetBean = valCtx.getTargetBean();
        if(targetBean==null)
            return null;
        ConfigBean parentBean = valCtx.getParentBean();
        return getConfigElementPrintName( valCtx,
                getFutureXPath(targetBean, parentBean),
                bIncludingKey, bReplaceRefByParentElem);
   }
View Full Code Here

    }
    public ConfigBean getParentBean()
    {
        if ((isSET()||isADD()) && (classObject instanceof ConfigBean) )
            return (ConfigBean)classObject;
        ConfigBean self = getTargetBean();
        try {
            return (ConfigBean)self.parent();
        } catch(Throwable t) {}
        return null;
    }
View Full Code Here

        }
        return result;
    }

    private Result performUpdateChecks(final Result result, final ConfigContextEvent cce){
        final ConfigBean co = (ConfigBean) cce.getClassObject();
        final String parentsDtdName = ((ConfigBean) co.parent()).dtdName();
        _logger.log(Level.FINEST, "SslTest update - parent's DTD name is \""+parentsDtdName+"\"");

        _logger.log(Level.FINEST, "SslTest update - attribute name is \""+cce.getName()+"\"");
        _logger.log(Level.FINEST, "SslTest update - attribute value is \""+cce.getObject()+"\"");
View Full Code Here

    public void validateAttribute(ConfigBean ownerBean, AttrType attr, Object value, ValidationContext valCtx)
    {
        if (attr.getName().equals(ServerTags.NAME) &&
            attr instanceof AttrString)
        {
            ConfigBean parent =  valCtx.getParentBean();
            if(parent instanceof J2eeApplication)
            {
                ((AttrString)attr).setRegExpression(
                   "[\\p{L}\\p{N}_][\\p{L}\\p{N}\\-_./;]*#[\\p{L}\\p{N}_][\\p{L}\\p{N}\\-_./;]*");
            }
View Full Code Here

        try {
            String applicationName =
                    endpoint.getWebService().getBundleDescriptor().getApplication().getRegistrationName();
            ConfigContext configContext =
                    ApplicationServer.getServerContext().getConfigContext();
            ConfigBean app =
                    ApplicationHelper.findApplication(configContext,applicationName);
            String type =
                    ApplicationHelper.getApplicationType(configContext,
                    applicationName);
            String endpointName = endpoint.getEndpointName();
View Full Code Here

TOP

Related Classes of com.sun.enterprise.config.ConfigBean

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.