Package org.glassfish.web.deployment.runtime

Examples of org.glassfish.web.deployment.runtime.CacheMapping


     * @return the descriptor instance to associate with this XMLNode
     */
    @Override
    public CacheMapping getDescriptor() {
        if (descriptor==null) {
            descriptor = new CacheMapping();
        }
        return descriptor;
    }
View Full Code Here


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

    public void startElement(XMLElement element, Attributes attributes) {
        CacheMapping descriptor = getDescriptor();
  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 org.glassfish.web.deployment.runtime.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.