Package com.webmethods.caf.faces.url
Class InMemoryStreamHandler
java.lang.Object
java.net.URLStreamHandler
org.osgi.service.url.AbstractURLStreamHandlerService
com.webmethods.caf.faces.url.InMemoryStreamHandler
- All Implemented Interfaces:
org.osgi.service.url.URLStreamHandlerService
public class InMemoryStreamHandler
extends org.osgi.service.url.AbstractURLStreamHandlerService
Implementation of
URLStreamHandler
, registered as a service
in osgi. Handles URL
s starting with the prefix "inmemory". The idea
is to pre-pend "inmemory" to any URL e.g inmemory:jar://path, so that the jvm
uses this handler. Then strip the url of "inmemory", construct the original
URL
, read its resource and cache it in memory instead of reading the
resource from file system. Used during the webserver MWS phase when jsf reads
tag libraries and faces.config files.-
Field Summary
FieldsFields inherited from class org.osgi.service.url.AbstractURLStreamHandlerService
realHandler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionopenConnection
(URL url) Open connection to the inmemory resource.void
Parses the URL string - spec parameter - extracts the original protocol and path, e.g file://path and puts it originalUrls map to be used later when URLConnection is requested in openConnection()Methods inherited from class org.osgi.service.url.AbstractURLStreamHandlerService
equals, getDefaultPort, getHostAddress, hashCode, hostsEqual, sameFile, setURL, setURL, toExternalForm
Methods inherited from class java.net.URLStreamHandler
openConnection, parseURL
-
Field Details
-
INMEMORY_PROTOCOL_PREFIX
- See Also:
-
-
Constructor Details
-
InMemoryStreamHandler
public InMemoryStreamHandler()
-
-
Method Details
-
openConnection
Open connection to the inmemory resource. If the resource is not found in memory, it reads is read by opening URL() to it.- Specified by:
openConnection
in interfaceorg.osgi.service.url.URLStreamHandlerService
- Specified by:
openConnection
in classorg.osgi.service.url.AbstractURLStreamHandlerService
- Throws:
IOException
-
parseURL
public void parseURL(org.osgi.service.url.URLStreamHandlerSetter rh, URL u, String spec, int start, int limit) Parses the URL string - spec parameter - extracts the original protocol and path, e.g file://path and puts it originalUrls map to be used later when URLConnection is requested in openConnection()- Specified by:
parseURL
in interfaceorg.osgi.service.url.URLStreamHandlerService
- Overrides:
parseURL
in classorg.osgi.service.url.AbstractURLStreamHandlerService
-