Package org.w3c.tools.resources

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


    public String toString() {
  ResourceReference rr = (ResourceReference) getSource();
  String ssource = null;
  String id = null;
  try {
      Resource resource = rr.lock();
      ssource = resource.getURLPath();
      id = resource.getIdentifier();
  } catch (InvalidResourceException ex) {
      ssource = "invalid";
  } catch (Exception ex) {
View Full Code Here


  } catch (Exception ex) {
      r_target = null;
  }
  if (r_target != null) {
    try {
      Resource target = r_target.lock();
      if (! (target instanceof PutListResource) )
        r_target = null;
      else
        list = r_target;
    } catch (InvalidResourceException ex) {
View Full Code Here

      synchronized (this) {
    ResourceReference rr = resolvePutListResource();
    PutListResource   l  = null;
    if (rr != null) {
        try {
      l = (PutListResource) rr.lock();
      if ( l != null ) {
          l.registerDeleteRequest(request);
          done = true;
      }
        } catch (InvalidResourceException ex) {
View Full Code Here

  m = (IndexerModule) getContext().getModule(IndexerModule.NAME);
  ResourceReference rri = m.getIndexer(superIndexer);
  if (rri == null)
      return null;
  try {
      ResourceIndexer p = (ResourceIndexer)rri.lock();
      return ((p != null)
        ? p.createResource(container, request, directory,
               name, defs)
        : null);
  } catch (InvalidResourceException ex) {
View Full Code Here

    static PutedEntry makeEntry(Request request) {
  ResourceReference rr = request.getTargetResource();
  Resource          r  = null;
  if (rr != null) {
    try {
      r = rr.lock();
      // Build an entry:
      PutedEntry e = new PutedEntry();
      e.setValue(ATTR_URL, request.getURL().toExternalForm());
      if ( r instanceof FileResource )
        e.setValue(ATTR_FILENAME,
View Full Code Here

      // verify that the target resource is putable
      ResourceReference rr = request.getTargetResource();
      if (rr != null) {
    try {
        FramedResource target = (FramedResource) rr.lock();
        HTTPFrame frame = null;
        try {
      frame = (HTTPFrame) target.getFrame(
          Class.forName("org.w3c.jigsaw.frames.HTTPFrame"));
        } catch (ClassNotFoundException cex) {
View Full Code Here

    static PutedEntry makeEntry(Request request) {
  ResourceReference rr = request.getTargetResource();
  Resource          r  = null;
  if (rr != null) {
      try {
    r = rr.lock();
    // Build an entry:
    DeletedEntry e = new DeletedEntry();
    e.setValue(ATTR_URL, request.getURL().toExternalForm());
    if ( r instanceof FileResource )
        e.setValue(ATTR_FILENAME,
View Full Code Here

    protected ResourceReference getTemplateFor(String ext) {
  ResourceReference rr = loadExtension(ext) ;
  if (rr != null) {
      try {
    Resource template = rr.lock();
    if (template != null) {
        Resource check = new Resource();
        if (template.getClass() == check.getClass())
      return null;
        else return rr;
View Full Code Here

                 Hashtable into) {
  Attribute    attrs[] = template.getAttributes();
  ResourceReference rr = loadExtension(ext) ;
  if (rr != null) {
      try {
    Resource e       = rr.lock() ;
    if ( e != null ) {
        for (int i = 0 ; i < attrs.length ; i++) {
      if ( ! template.definesAttribute(i) ) {
          int idx = e.lookupAttribute(attrs[i].getName());
          if ( idx >= 0 ) {
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.