Package org.apache.naming.resources
Class DirContextURLStreamHandlerService
- java.lang.Object
-
- java.net.URLStreamHandler
-
- org.osgi.service.url.AbstractURLStreamHandlerService
-
- org.apache.naming.resources.DirContextURLStreamHandlerService
-
- All Implemented Interfaces:
org.osgi.framework.BundleActivator
,org.osgi.service.url.URLStreamHandlerService
public class DirContextURLStreamHandlerService extends org.osgi.service.url.AbstractURLStreamHandlerService implements org.osgi.framework.BundleActivator
This class is responsible for addingDirContextURLStreamHandler
to OSGi service registry. As much as we would have liked it to be both an activator as well as a Startup service, we can't. In embedded mode, this Startup service would fail to load, so we have separated the startup servuce part toWebNamingStartup
class. That Startup service ensures that this bundle gets activated during server startup and the activator ensures that we register a jndi protocol handler.- Author:
- [email protected]
-
-
Constructor Summary
Constructors Constructor Description DirContextURLStreamHandlerService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description URLConnection
openConnection(URL u)
void
start(org.osgi.framework.BundleContext context)
void
stop(org.osgi.framework.BundleContext context)
String
toExternalForm(URL u)
-
Methods inherited from class org.osgi.service.url.AbstractURLStreamHandlerService
equals, getDefaultPort, getHostAddress, hashCode, hostsEqual, parseURL, sameFile, setURL, setURL
-
Methods inherited from class java.net.URLStreamHandler
openConnection, parseURL
-
-
-
-
Method Detail
-
openConnection
public URLConnection openConnection(URL u) throws IOException
- Specified by:
openConnection
in interfaceorg.osgi.service.url.URLStreamHandlerService
- Specified by:
openConnection
in classorg.osgi.service.url.AbstractURLStreamHandlerService
- Throws:
IOException
-
toExternalForm
public String toExternalForm(URL u)
- Specified by:
toExternalForm
in interfaceorg.osgi.service.url.URLStreamHandlerService
- Overrides:
toExternalForm
in classorg.osgi.service.url.AbstractURLStreamHandlerService
-
start
public void start(org.osgi.framework.BundleContext context) throws Exception
- Specified by:
start
in interfaceorg.osgi.framework.BundleActivator
- Throws:
Exception
-
-