org.gloin.resource
Class URLInputStreamFactory

java.lang.Object
  |
  +--org.gloin.resource.URLInputStreamFactory
All Implemented Interfaces:
InputStreamFactory, java.io.Serializable

public class URLInputStreamFactory
extends java.lang.Object
implements InputStreamFactory, java.io.Serializable

Implementation of InputStreamFactory which uses URLs to send resources to requesting clients. The newInputStream method of this factory returns, URLInputStreams which are serializable and contain a single field reference to a URL object. On the client side, when a method is invoked on a URLInputStream, the stream will initialize itself by calling URL.openStream(). The URLInputStream will delegate to the stream return value of that method to carry out the method call on itself.

See Also:
Serialized Form

Inner Class Summary
 class URLInputStreamFactory.URLInputStream
          InputStream which obtains resource bytes remote a remote byte store.
 
Constructor Summary
URLInputStreamFactory(java.lang.String baseURL)
           
 
Method Summary
 int hashCode()
           
 java.io.InputStream newInputStream(java.lang.String resourceName)
          Create a new input stream for a given resource
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

URLInputStreamFactory

public URLInputStreamFactory(java.lang.String baseURL)
Method Detail

newInputStream

public java.io.InputStream newInputStream(java.lang.String resourceName)
                                   throws java.net.MalformedURLException
Create a new input stream for a given resource
Specified by:
newInputStream in interface InputStreamFactory
Following copied from interface: org.gloin.resource.InputStreamFactory
Parameters:
resourceName - name of the resource for which a stream should be created
Returns:
the newly created input stream

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object