Package org.w3c.tools.resources

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


      return (String)
    request.getState(JigsawRequestDispatcher.SERVLET_PATH_P);
  } else {
      ResourceReference rr = request.getTargetResource();
      try {
    return rr.lock().getURLPath();
      } catch (InvalidResourceException ex) {
    return null;
      } finally {
    rr.unlock();
      }
View Full Code Here


      LookupResult  lr  = new LookupResult(root.getResourceReference());
      if (root.lookup(ls,lr)) {
    ResourceReference  target = lr.getTarget();
    if (target != null) {
        try {
      Resource res = target.lock();
      if (res instanceof CheckpointResource) {
          ((CheckpointResource) res).activate();
          errlog("Chekpointer started at: "+new Date()+".");
      } else {
          errlog("The chekpointer url ("+checkurl+
View Full Code Here

  ResourceReference newroot = loadRoot(name);
  FramedResource oldroot = this.root;
  String oldroot_name = this.root_name;
  if ( newroot != null ) {
      try {
    this.root      = (FramedResource)newroot.lock();
    this.root_name = name;
    if (root_reference != null)
        root_reference.unlock();
    root_reference = newroot;
    return root;
View Full Code Here

        if (target != null) {
      try {
          // this is plain ugly and won't work for proxy
          // not based on this resource
          // do we need another way to to this?
          FramedResource fr = (FramedResource) target.lock();
          Class cff = Class.forName(
                  "org.w3c.jigsaw.proxy.ForwardFrame");
          doit = (fr.getFrameReference(cff) == null);
      } catch (Exception ex) {
          // fail miserably to the fallback
View Full Code Here

      //perform the request:
      if ((error == null) && (target != null)) {
    request.setFilters(filters, infilter);
    request.setTargetResource(target);
    try {
        FramedResource res = (FramedResource)target.lock();
        reply = (Reply) res.perform(request);
        if (reply == null) {
      reply = request.makeReply(HTTP.NOT_FOUND);
      if (uri_error) {
          reply.setContent("<html><head><title>Not Found" +
View Full Code Here

    public Servlet getServlet(String name) {
  if (dresource != null) {
      ResourceReference rr = dresource.lookup(name);
      if (rr != null) {
    try {
        Resource resource = rr.lock();
        if (resource instanceof ServletWrapper)
      return ((ServletWrapper) resource).getServlet();
    } catch (InvalidResourceException ex) {
        return null;
    } finally {
View Full Code Here

    public boolean isServletLoaded(String name) {
  if (dresource != null) {
      ResourceReference rr = dresource.lookup(name);
      if (rr != null) {
    try {
        Resource resource = rr.lock();
        if (resource instanceof ServletWrapper)
      return ((ServletWrapper) resource).isServletLoaded();
    } catch (InvalidResourceException ex) {
        return false;
    } finally {
View Full Code Here

    Enumeration e   = realm.enumerateUserNames() ;
    while (e.hasMoreElements()) {
        String   uname = (String) e.nextElement() ;
        ResourceReference rr_user = realm.loadUser(uname) ;
        try {
      AuthUser user  = (AuthUser) rr_user.lock();
      createEntry(user);
        } catch (InvalidResourceException ex) {
      System.out.println("Invalid user reference : "+uname);
        } finally {
      rr_user.unlock();
View Full Code Here

      root.lookup(ls, lr);
      ResourceReference rr = lr.getTarget();
      if (rr != null) {
          try {
        ServletWrapper wrapper =
            (ServletWrapper) rr.lock();
        wrapper.checkServlet();
          } catch(InvalidResourceException ex) {
        ex.printStackTrace();
          } catch (ClassNotFoundException cnfex) {
        cnfex.printStackTrace();
View Full Code Here

     * @return a ResourceReference
     */
    protected ResourceReference getServletDirectoryReference(httpd server) {
  ResourceReference rr = server.getEditRoot();
  try {
      FramedResource root = (FramedResource) rr.lock();
      try {
    LookupState  ls = new LookupState(SERVLET_BASE_P);
    LookupResult lr =
        new LookupResult(root.getResourceReference());
    root.lookup(ls, lr);
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.