public class InMemoryStreamHandler
extends org.osgi.service.url.AbstractURLStreamHandlerService
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.Modifier and Type | Field and Description |
---|---|
static String |
INMEMORY_PROTOCOL_PREFIX |
Constructor and Description |
---|
InMemoryStreamHandler() |
Modifier and Type | Method and Description |
---|---|
URLConnection |
openConnection(URL url)
Open connection to the inmemory resource.
|
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()
|
equals, getDefaultPort, getHostAddress, hashCode, hostsEqual, sameFile, setURL, setURL, toExternalForm
openConnection, parseURL
public static final String INMEMORY_PROTOCOL_PREFIX
public URLConnection openConnection(URL url) throws IOException
openConnection
in interface org.osgi.service.url.URLStreamHandlerService
openConnection
in class org.osgi.service.url.AbstractURLStreamHandlerService
IOException
public void parseURL(org.osgi.service.url.URLStreamHandlerSetter rh, URL u, String spec, int start, int limit)
parseURL
in interface org.osgi.service.url.URLStreamHandlerService
parseURL
in class org.osgi.service.url.AbstractURLStreamHandlerService