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

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


  dispatchTable.put(RuntimeTagNames.DISPATCHER, "addNewDispatcher")
  return dispatchTable;
    }

    public void startElement(XMLElement element, Attributes attributes) {
        CacheMapping descriptor = (CacheMapping) getRuntimeDescriptor();
  if (descriptor==null) {
      throw new RuntimeException("Trying to set values on a null descriptor");
  }  
  if (element.getQName().equals(RuntimeTagNames.TIMEOUT)) {
            for (int i=0; i<attributes.getLength();i++) {
                if (RuntimeTagNames.NAME.equals(attributes.getQName(i))) {
        descriptor.setAttributeValue(CacheMapping.TIMEOUT, CacheMapping.NAME, attributes.getValue(i));
                } else
                if (RuntimeTagNames.SCOPE.equals(attributes.getQName(i))) {
                    int index=0;
                    while (descriptor.getAttributeValue(CacheMapping.TIMEOUT, index, CacheMapping.NAME)!=null) {
                        index++;
                    }
        descriptor.setAttributeValue(CacheMapping.TIMEOUT, index-1, CacheMapping.SCOPE, attributes.getValue(i));
         
            }
   } else
  if (element.getQName().equals(RuntimeTagNames.REFRESH_FIELD)) {
      descriptor.setRefreshField(true);
            for (int i=0; i<attributes.getLength();i++) {
          if (RuntimeTagNames.NAME.equals(attributes.getQName(i))) {
        descriptor.setAttributeValue(CacheMapping.REFRESH_FIELD, 0, CacheMapping.NAME, attributes.getValue(i));
          } else
          if (RuntimeTagNames.SCOPE.equals(attributes.getQName(i))) {
                    descriptor.setAttributeValue(CacheMapping.REFRESH_FIELD, 0, CacheMapping.SCOPE, attributes.getValue(i));
                }
      } 
  } else
  if (element.getQName().equals(RuntimeTagNames.KEY_FIELD)) {
      descriptor.addKeyField(true);
            for (int i=0; i<attributes.getLength();i++) {
                if (RuntimeTagNames.NAME.equals(attributes.getQName(i))) {
        descriptor.setAttributeValue(CacheMapping.KEY_FIELD, CacheMapping.NAME, attributes.getValue(i));
          } else
                if (RuntimeTagNames.SCOPE.equals(attributes.getQName(i))) {
                    int index = descriptor.sizeKeyField();              
              descriptor.setAttributeValue(CacheMapping.KEY_FIELD, index-1, CacheMapping.SCOPE, attributes.getValue(i));
          }
            }
  } else super.startElement(element, attributes);
    }
View Full Code Here


  dispatchTable.put(RuntimeTagNames.DISPATCHER, "addNewDispatcher")
  return dispatchTable;
    }

    public void startElement(XMLElement element, Attributes attributes) {
        CacheMapping descriptor = (CacheMapping) getRuntimeDescriptor();
  if (descriptor==null) {
      throw new RuntimeException("Trying to set values on a null descriptor");
  }  
  if (element.getQName().equals(RuntimeTagNames.TIMEOUT)) {
            for (int i=0; i<attributes.getLength();i++) {
                if (RuntimeTagNames.NAME.equals(attributes.getQName(i))) {
        descriptor.setAttributeValue(CacheMapping.TIMEOUT, CacheMapping.NAME, attributes.getValue(i));
                } else
                if (RuntimeTagNames.SCOPE.equals(attributes.getQName(i))) {
                    int index=0;
                    while (descriptor.getAttributeValue(CacheMapping.TIMEOUT, index, CacheMapping.NAME)!=null) {
                        index++;
                    }
        descriptor.setAttributeValue(CacheMapping.TIMEOUT, index-1, CacheMapping.SCOPE, attributes.getValue(i));
         
            }
   } else
  if (element.getQName().equals(RuntimeTagNames.REFRESH_FIELD)) {
      descriptor.setRefreshField(true);
            for (int i=0; i<attributes.getLength();i++) {
          if (RuntimeTagNames.NAME.equals(attributes.getQName(i))) {
        descriptor.setAttributeValue(CacheMapping.REFRESH_FIELD, 0, CacheMapping.NAME, attributes.getValue(i));
          } else
          if (RuntimeTagNames.SCOPE.equals(attributes.getQName(i))) {
                    descriptor.setAttributeValue(CacheMapping.REFRESH_FIELD, 0, CacheMapping.SCOPE, attributes.getValue(i));
                }
      } 
  } else
  if (element.getQName().equals(RuntimeTagNames.KEY_FIELD)) {
      descriptor.addKeyField(true);
            for (int i=0; i<attributes.getLength();i++) {
                if (RuntimeTagNames.NAME.equals(attributes.getQName(i))) {
        descriptor.setAttributeValue(CacheMapping.KEY_FIELD, CacheMapping.NAME, attributes.getValue(i));
          } else
                if (RuntimeTagNames.SCOPE.equals(attributes.getQName(i))) {
                    int index = descriptor.sizeKeyField();              
              descriptor.setAttributeValue(CacheMapping.KEY_FIELD, index-1, CacheMapping.SCOPE, attributes.getValue(i));
          }
            }
  } else super.startElement(element, attributes);
    }
View Full Code Here

TOP

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

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.