Package org.w3c.tools.resources

Examples of org.w3c.tools.resources.ResourceReference.lock()


      }
      if (dac != null) {
    ResourceReference rr_user =
        (ResourceReference)lookupUser(dac.dac_user) ;
    try {
        AuthUser user = (AuthUser) rr_user.lock();
        // This user doesn't even exists !
        if ( user != null ) {
      // If it has a password check it
      if (user.definesAttribute("password") ) {
          if (dac.authenticate(user.getName(),
View Full Code Here


    {
  String uri  = SERVLET_BASE_P+"/"+name;
  // internal lookup
  ResourceReference rr = server.getEditRoot();
  try {
      FramedResource root = (FramedResource) rr.lock();
      try {
    DirectoryResource parent = (DirectoryResource) sdir.lock();
    LookupState  ls = new LookupState(uri);
    LookupResult lr =
        new LookupResult(root.getResourceReference());
View Full Code Here

    root.lookup(ls, lr);
    ResourceReference target = lr.getTarget();
    if (target != null) {
        try {
      ServletWrapper wrapper =
          (ServletWrapper) target.lock();
      initialize(name, wrapper, parent);
        } finally {
      target.unlock();
        }
    } else { // doesn't exists, so create it...
View Full Code Here

        resource.registerFrame(negotiated, f_defs);
    }
      } else {
    try {
        NegotiatedFrame negotiated =
      (NegotiatedFrame) rr_neg_frame.lock();
        String variants[]  = negotiated.getVariantNames() ;
        boolean exists = false;
        for ( int i=0 ; i < variants.length ; i++ ) {
      if (variants[i].equals(name))
          exists = true;
View Full Code Here

    lr.setTarget(null);
    return false;
      }
      try {
    lr.setTarget(rr);
    FramedResource resource = (FramedResource) rr.lock();
    return (resource != null ) ? resource.lookup(ls, lr) : false;
      } catch (InvalidResourceException ex) {
    return false;
      } finally {
    rr.unlock();
View Full Code Here

      if ( tempdefs.get(s_dir) == null )
    tempdefs.put(s_dir, directory) ;
      if ( tempdefs.get(s_con) == null )
    tempdefs.put(s_con, getContext());
      try {
    template = (FramedResource) rr.lock();
    if (template instanceof ServletWrapper) {
        if (tempdefs.get(s_ser) == null)
      tempdefs.put(s_ser, name);
        String id = getIndexedFileName(name);
        tempdefs.put(s_ide, id) ;
View Full Code Here

        (DirectoryResource) resource;
          ResourceReference rr = dir.lookup(index);
          if (rr != null) {
        try {
            FramedResource rindex =
          (FramedResource) rr.lock();
            return rindex.lookup(ls,lr);
        } catch (InvalidResourceException ex) {
        } finally {
            rr.unlock();
        }
View Full Code Here

          // fancy message. file not present
          // Or security manager forbiding deletion.
      }
      // and now, at least remove the resource
      try {
          toDeleteRes = (Resource) rr.lock();
          toDeleteRes.delete();
      } catch (Exception ex) {
          // some other locks... or pb with the resource
      } finally {
          rr.unlock();
View Full Code Here

    }
    try {
        // because the root eats the lookup state components
        // we have to return true.
        // Should not be continued by the caller.
        FramedResource res = (FramedResource)root.lock();
        boolean done = res.lookup(ls, lr);
        if (! done)
      lr.setTarget(null);
        return true;
    } catch (InvalidResourceException ex) {
View Full Code Here

  }
  if ( defs.get(s_con) == null ) {
      defs.put(s_con, getContext());
  }
  try {
      template = (FramedResource) rr.lock();
      if (exts != null) {
    // Merge with values defined by the extension:
    for (int i = exts.length ; --i >= 0 ; )
        mergeDefaultAttributes(template, exts[i], defs) ;
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.