net.gloin.resource
Interface ResourceService

All Known Subinterfaces:
RemoteResourceService

public interface ResourceService

Enable Jini services to store and export resource byte arrays (e.g. to store byte codes) in a network resource service.

Provides methods to create new resources and to obtain ResourceAccess proxies which can be used in the JRAP URL protocol handler to download resource bytes into service clients.

Services of this type should not be registered directly in a Jini Lookup Service, instead, they should be placed into the Lookup as an attribute of a ResourceAccess service.


Method Summary
 ResourceAccess getAccess()
          Obtain a ResourceAccess object which can be used to download resource bytes from a corresponding resource service.
 java.lang.String[] list()
          List the names of the resources that have been created in this resource service.
 ResourceHandle newResource(java.lang.String name)
          Create a new resource in the resource service that will serve as a placeholder until the resource is filled with bytes from a registering service.
 

Method Detail

newResource

public ResourceHandle newResource(java.lang.String name)
                           throws java.io.IOException
Create a new resource in the resource service that will serve as a placeholder until the resource is filled with bytes from a registering service. Initially the resource is created empty.
Parameters:
name - of the resource which should be created.
Returns:
a handle to the newly created resource

getAccess

public ResourceAccess getAccess()
                         throws java.io.IOException
Obtain a ResourceAccess object which can be used to download resource bytes from a corresponding resource service.
Returns:
ResourceAccess object for downloading resources.

list

public java.lang.String[] list()
                        throws java.io.IOException
List the names of the resources that have been created in this resource service.
Returns:
array of names of resources created in this resource service.