net.gloin.resource.util
Class ResourceRegistration

java.lang.Object
  |
  +--net.gloin.resource.util.ResourceRegistration

public final class ResourceRegistration
extends java.lang.Object

Provides an easy to use utility for Jini services that wish to register bytes with a resource service.


Constructor Summary
ResourceRegistration()
           
 
Method Summary
static java.net.URL[] register(java.lang.String resourceServiceLocation, java.io.InputStream resourceStream)
          Register a resource with a resource service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceRegistration

public ResourceRegistration()
Method Detail

register

public static final java.net.URL[] register(java.lang.String resourceServiceLocation,
                                            java.io.InputStream resourceStream)
                                     throws java.io.IOException
Register a resource with a resource service. The resource service is located using the JRAP formatted string, resourceServiceLocation to find a ResourceAccess service. Attributes of discovered access proxies are searched to find a resource service into which resource bytes may be stored. Once a resource service is discovered, an attempt to create a new resource is made. If ResourceRegisteredException is thrown the registration attempt is aborted and considered successful. If no exception is thrown, the new resource is filled.
Parameters:
resourceServiceLocation - a JRAP URL formatted string which identifies the location of a resource access service.
resourceStream - the byte stream from which resource bytes will be read by a receiving resource service.
Returns:
an array of URL formatted strings containing the codebase annotations of resource services with which resource bytes were registered.