Package org.apache.excalibur.source

Examples of org.apache.excalibur.source.SourceValidity


        // Source exists
        Object[] values = (Object[])this.mountTables.get(uri);
       
        if (values != null) {
            // Check validity
            SourceValidity oldValidity = (SourceValidity)values[1];
            int valid = oldValidity.isValid();
            if (valid == 1) {
                // Valid without needing the new validity
                return (Map)values[0];
            }
           
            if (valid == 0 && oldValidity.isValid(source.getValidity()) == 1) {
                // Valid after comparing with the new validity
                return (Map)values[0];
            }
           
            // Invalid: fallback below to read the mount table
View Full Code Here


                    int valid = SourceValidity.UNKNOWN;
                    if (startEvent.compileTime != null) {
                        valid = startEvent.compileTime.isValid();
                    }
                    if (valid == SourceValidity.UNKNOWN && startEvent.compileTime != null) {
                        SourceValidity validity = inputSource.getValidity();
                        valid = startEvent.compileTime.isValid(validity);
                    }
                    if (valid != SourceValidity.VALID) {
                        cache.remove(uri);
                    }
View Full Code Here

                }
                Source input = null;
                StartDocument doc;
                try {
                    input = resolver.resolveURI(uri);
                    SourceValidity validity = null;
                    synchronized (cache) {
                        doc = (StartDocument)cache.get(input.getURI());
                        if (doc != null) {
                            boolean recompile = false;
                            if ( doc.compileTime == null) {
View Full Code Here

            Iterator iter = javaSource.entrySet().iterator();
            List invalid = new LinkedList();
            while (iter.hasNext()) {
                Map.Entry e = (Map.Entry)iter.next();
                String uri = (String)e.getKey();
                SourceValidity validity =
                    (SourceValidity)e.getValue();
                int valid = validity.isValid();
                if (valid == SourceValidity.UNKNOWN) {
                    Source newSrc = null;
                    try {
                        newSrc = sourceResolver.resolveURI(uri);
                        valid = newSrc.getValidity().isValid(validity);
View Full Code Here

        Source source = null;
        SourceResolver resolver = null;
        try {
            resolver = (SourceResolver)manager.lookup(SourceResolver.ROLE);
            source = resolver.resolveURI(sourceURL);
            SourceValidity sourceValidity = source.getValidity();
            if (validity == null || validity.isValid( sourceValidity ) == SourceValidity.INVALID) {
                HashMap values = new HashMap();
                SourceUtil.toSAX(source, new SAXContentHandler(values));
                this.validity = sourceValidity;
                this.values = values;
View Full Code Here

        public synchronized Document getDocument(ComponentManager manager,
                                                 SourceResolver resolver,
                                                 Logger logger) throws Exception {

            Source src = null;
            SourceValidity valid = null;
            Document dom = null;

            if (this.document == null) {
                if (logger.isDebugEnabled())
                    logger.debug("document not cached... reloading uri "+this.uri);
View Full Code Here

       
                // FIXME - disabled saving for testing
                // adapter.saveProfile(key, result[0]);

        // set validity for created user profile
        SourceValidity newValidity = adapter.getValidity(key);
        if (newValidity != null) {
          Object[] objects = new Object[] { result[0], newValidity };
          service.setAttribute(SimpleProfileManager.class.getName()+location+"-user-"+map.get("user"), objects);
        } else {
                    Object[] objects = new Object[] { result[0], null };
View Full Code Here

      adapter = (MapSourceAdapter) this.manager.lookup(MapSourceAdapter.ROLE);

      Object[] objects = (Object[]) service.getAttribute(SimpleProfileManager.class.getName() + location);
     
      // check whether still valid
      SourceValidity sourceValidity = null;
      if (objects != null)
        sourceValidity = (SourceValidity)objects[1];
      Object[] validity = this.getValidity(key, location, sourceValidity, adapter);
      if (((Boolean)validity[0]).booleanValue()) {
        if (objects == null) {
          return new Object[]{null, Boolean.FALSE};
        } else {
          return new Object[]{objects[0], Boolean.FALSE};
        }
      }
     
      // load profile
      SourceValidity newValidity = (SourceValidity)validity[1];
      Object object = adapter.loadProfile(key);
      if (newValidity != null) {
        objects = new Object[] { object, newValidity };
        service.setAttribute(SimpleProfileManager.class.getName() + location, objects);
      }
View Full Code Here

          return new Object[]{objects[0], Boolean.FALSE};
        }
      }

      // load profile
      SourceValidity newValidity = (SourceValidity)validity[1];
      Object object = adapter.loadProfile(key);
      if (newValidity != null) {
        objects = new Object[] { object, newValidity };
        service.setAttribute(SimpleProfileManager.class.getName() + location, objects);
      }
View Full Code Here

    MapSourceAdapter adapter = null;
    try {
      adapter = (MapSourceAdapter) this.manager.lookup(MapSourceAdapter.ROLE);

      Object[] objects = (Object[]) service.getAttribute(SimpleProfileManager.class.getName() + location);
      SourceValidity sourceValidity = null;
      if (objects != null)
        sourceValidity = (SourceValidity)objects[1];
     
      return this.getValidity(key, location, sourceValidity, adapter);
    } finally {
View Full Code Here

TOP

Related Classes of org.apache.excalibur.source.SourceValidity

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.