org.glassfish.osgihttp
Class HttpServiceWrapper.HttpServiceFactory

java.lang.Object
  extended by org.glassfish.osgihttp.HttpServiceWrapper.HttpServiceFactory
All Implemented Interfaces:
org.osgi.framework.ServiceFactory
Enclosing class:
HttpServiceWrapper

public static class HttpServiceWrapper.HttpServiceFactory
extends Object
implements org.osgi.framework.ServiceFactory

This service factory is needed, because the spec requires the following: If the bundle which performed the registration is stopped or otherwise "unget"s the Http Service without calling unregister(java.lang.String) then Http Service must automatically unregister the registration. However, if the registration was for a servlet, the destroy method of the servlet will not be called in this case since the bundle may be stopped. unregister(java.lang.String) must be explicitly called to cause the destroy method of the servlet to be called. This can be done in the BundleActivator.stop method of the bundle registering the servlet.


Constructor Summary
HttpServiceWrapper.HttpServiceFactory(GlassFishHttpService delegate)
           
 
Method Summary
 Object getService(org.osgi.framework.Bundle bundle, org.osgi.framework.ServiceRegistration registration)
           
 void ungetService(org.osgi.framework.Bundle bundle, org.osgi.framework.ServiceRegistration registration, Object service)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpServiceWrapper.HttpServiceFactory

public HttpServiceWrapper.HttpServiceFactory(GlassFishHttpService delegate)
Method Detail

getService

public Object getService(org.osgi.framework.Bundle bundle,
                         org.osgi.framework.ServiceRegistration registration)
Specified by:
getService in interface org.osgi.framework.ServiceFactory

ungetService

public void ungetService(org.osgi.framework.Bundle bundle,
                         org.osgi.framework.ServiceRegistration registration,
                         Object service)
Specified by:
ungetService in interface org.osgi.framework.ServiceFactory


Copyright © 2012 GlassFish Community. All Rights Reserved.