Package de.tuclausthal.informatik.winf.mobileagents.resource

Examples of de.tuclausthal.informatik.winf.mobileagents.resource.ResourceProvider


  {
    // is agent's resource?
    if (!this.agentInfo.getResourceList().hasResource(resource))
      return;

    ResourceProvider rp =
      ResourceManager.getInstance().getResourceProvider(resource);
    rp.closeResource(resource);
  }
View Full Code Here


   */
  public void closeResource(Resource r)
  {
    if(this.resources.contains(r))
    {
      ResourceProvider p = ResourceManager.getInstance().getResourceProvider(r);
      p.closeResource(r);
      this.resources.remove(r);
    } else
    {
      throw new RuntimeException("This resource does not exist in this ResourceList!");
    }
View Full Code Here

  public ResourceProvider getResourceProvider(String protocol)
  {
    // iterate over all registered ResourceProviders
    for(int i = 0; i < this.resourceProviders.size(); i++)
    {
      ResourceProvider retval =
        (ResourceProvider)this.resourceProviders.get(i);
       
      // and see, if one matches
      if(retval.getName().equals(protocol))
      {
        return retval;
      }
    }
   
View Full Code Here

  {
    int index = resource.indexOf("://");
    if(!(index > 0)) return null;
    String rn = resource.substring(0, index); // resource name
   
    ResourceProvider rp = this.getResourceProvider(rn);
    if(rp == null) return null;
    return rp.createResource(resource, writable, agentInfo);
  }
View Full Code Here

  public ResourceProvider getResourceProvider(Resource resource)
  {
    // iterate over all registered ResourceProviders
    for(int i = 0; i < this.resourceProviders.size(); i++)
    {
      ResourceProvider retval =
        (ResourceProvider)this.resourceProviders.get(i);
       
      // and see, if one matches
      if(retval.hasCreated(resource))
      {
        return retval;
      }
    }
   
View Full Code Here

TOP

Related Classes of de.tuclausthal.informatik.winf.mobileagents.resource.ResourceProvider

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.