org.glassfish.osgihttp
Class OSGiServletWrapper

java.lang.Object
  extended by org.apache.catalina.core.ContainerBase
      extended by org.apache.catalina.core.StandardWrapper
          extended by org.glassfish.osgihttp.OSGiServletWrapper
All Implemented Interfaces:
Serializable, MBeanRegistration, javax.servlet.ServletConfig, org.apache.catalina.Container, org.apache.catalina.Lifecycle, org.apache.catalina.Pipeline, org.apache.catalina.Wrapper

public class OSGiServletWrapper
extends org.apache.catalina.core.StandardWrapper
implements org.apache.catalina.Wrapper

Unlike Java EE Web Application model, there is no notion of "context path" in OSGi HTTP service spec. Here the servlets can specify which context they belong to by passing a HttpContext object. Those HttpContext objects don't have any "path" attribute. As a result, all the OSGi/HTTP servlets belonging to the same servlet context may not have any of the path common to them. Internally, we register all the OSGi servlets (actually we register OSGiServletWrapper with the same Context object. So we need a way to demultiplex the OSGi servlet context.

Author:
Sanjeeb.Sahoo@Sun.COM
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.catalina.core.ContainerBase
org.apache.catalina.core.ContainerBase.ContainerBackgroundProcessor, org.apache.catalina.core.ContainerBase.PrivilegedAddChild
 
Field Summary
 
Fields inherited from class org.apache.catalina.core.ContainerBase
backgroundProcessorDelay, checkIfRequestIsSecure, children, controller, domain, hasCustomPipeline, initialized, lifecycle, listeners, loader, logger, manager, mserver, name, notifyContainerListeners, oname, parent, parentClassLoader, pipeline, readLock, realm, resources, sm, started, suffix, support, type, writeLock
 
Fields inherited from interface org.apache.catalina.Container
ADD_CHILD_EVENT, ADD_MAPPER_EVENT, ADD_VALVE_EVENT, REMOVE_CHILD_EVENT, REMOVE_MAPPER_EVENT, REMOVE_VALVE_EVENT
 
Fields inherited from interface org.apache.catalina.Lifecycle
AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, INIT_EVENT, START_EVENT, STOP_EVENT
 
Constructor Summary
OSGiServletWrapper(String name, javax.servlet.Servlet servlet, OSGiServletConfig config, String urlMapping, com.sun.enterprise.web.WebModule webModule)
           
 
Method Summary
 void addValve(org.glassfish.web.valve.GlassFishValve valve)
           
 javax.servlet.Servlet allocate()
           
 javax.servlet.Servlet getServlet()
           
 javax.servlet.ServletContext getServletContext()
           
 String getServletName()
           
 com.sun.enterprise.web.WebModule getWebModule()
           
 void load()
           
 void unload()
           
 
Methods inherited from class org.apache.catalina.core.StandardWrapper
addChild, addDefaultMapper, addInitParameter, addInstanceListener, addMapping, addSecurityReference, deallocate, findInitParameter, findInitParameters, findMappingObject, findMappings, findSecurityReference, findSecurityReferences, getAvailable, getClassLoadTime, getCountAllocated, getDebug, getDescription, getEngineName, getInfo, getInitParameter, getInitParameterNames, getInitParameters, getInstanceSupport, getJspFile, getLoadOnStartup, getLoadOnStartupString, getLoadTime, getMappings, getMaxInstances, getMultipartFileSizeThreshold, getMultipartLocation, getMultipartMaxFileSize, getMultipartMaxRequestSize, getRootCause, getRunAs, getServletClass, getServletClassName, getServletMethods, isAsyncSupported, isEventProvider, isOSGi, isStateManageable, isStatisticsProvider, isUnavailable, logName, registerJMX, removeInitParameter, removeInstanceListener, removeMapping, removeSecurityReference, setAvailable, setDebug, setDescription, setInitParameter, setInitParameters, setIsAsyncSupported, setJspFile, setLoadOnStartup, setLoadOnStartupString, setLoadTime, setMaxInstances, setMultipartFileSizeThreshold, setMultipartLocation, setMultipartMaxFileSize, setMultipartMaxRequestSize, setOSGi, setParent, setRunAs, setServlet, setServletClass, setServletClassName, setServletName, start, stop, toString, unavailable
 
Methods inherited from class org.apache.catalina.core.ContainerBase
addContainerListener, addLifecycleListener, addPropertyChangeListener, addValve, backgroundProcess, createObjectName, destroy, findChild, findChildren, findContainerListeners, findLifecycleListeners, fireContainerEvent, getBackgroundProcessorDelay, getBasic, getChildren, getContainerSuffix, getDomain, getJmxName, getJSR77Suffix, getLoader, getLogger, getManager, getMappingObject, getName, getObjectName, getParent, getParentClassLoader, getParentName, getPipeline, getRealm, getResources, getType, getValveObjectNames, getValves, hasCustomPipeline, hasNonBasicValves, init, invoke, isCheckIfRequestIsSecure, log, log, postDeregister, postRegister, preDeregister, preRegister, removeChild, removeContainerListener, removeLifecycleListener, removeLifecycleListeners, removePropertyChangeListener, removeValve, setBackgroundProcessorDelay, setBasic, setCheckIfRequestIsSecure, setDomain, setLoader, setLogger, setManager, setName, setParentClassLoader, setRealm, setResources, startChildren, threadStart, threadStop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.catalina.Wrapper
addInitParameter, addInstanceListener, addMapping, addSecurityReference, deallocate, findInitParameter, findInitParameters, findMappings, findSecurityReference, findSecurityReferences, getAvailable, getDescription, getJspFile, getLoadOnStartup, getMultipartFileSizeThreshold, getMultipartLocation, getMultipartMaxFileSize, getMultipartMaxRequestSize, getRunAs, getServletClassName, getServletMethods, isAsyncSupported, isUnavailable, removeInitParameter, removeInstanceListener, removeMapping, removeSecurityReference, setAvailable, setDescription, setIsAsyncSupported, setJspFile, setLoadOnStartup, setMultipartFileSizeThreshold, setMultipartLocation, setMultipartMaxFileSize, setMultipartMaxRequestSize, setRunAs, setServletClass, setServletClassName, unavailable
 
Methods inherited from interface org.apache.catalina.Container
addChild, addContainerListener, addPropertyChangeListener, backgroundProcess, findChild, findChildren, findContainerListeners, fireContainerEvent, getBackgroundProcessorDelay, getInfo, getLoader, getLogger, getManager, getMappingObject, getName, getParent, getParentClassLoader, getPipeline, getRealm, getResources, hasCustomPipeline, invoke, isCheckIfRequestIsSecure, removeChild, removeContainerListener, removePropertyChangeListener, setBackgroundProcessorDelay, setCheckIfRequestIsSecure, setLoader, setLogger, setManager, setName, setParent, setParentClassLoader, setRealm, setResources
 

Constructor Detail

OSGiServletWrapper

public OSGiServletWrapper(String name,
                          javax.servlet.Servlet servlet,
                          OSGiServletConfig config,
                          String urlMapping,
                          com.sun.enterprise.web.WebModule webModule)
Method Detail

getServlet

public javax.servlet.Servlet getServlet()
Overrides:
getServlet in class org.apache.catalina.core.StandardWrapper

getServletName

public String getServletName()
Specified by:
getServletName in interface javax.servlet.ServletConfig
Specified by:
getServletName in interface org.apache.catalina.Wrapper
Overrides:
getServletName in class org.apache.catalina.core.StandardWrapper

getServletContext

public javax.servlet.ServletContext getServletContext()
Specified by:
getServletContext in interface javax.servlet.ServletConfig
Overrides:
getServletContext in class org.apache.catalina.core.StandardWrapper

allocate

public javax.servlet.Servlet allocate()
                               throws javax.servlet.ServletException
Specified by:
allocate in interface org.apache.catalina.Wrapper
Overrides:
allocate in class org.apache.catalina.core.StandardWrapper
Throws:
javax.servlet.ServletException

load

public void load()
          throws javax.servlet.ServletException
Specified by:
load in interface org.apache.catalina.Wrapper
Overrides:
load in class org.apache.catalina.core.StandardWrapper
Throws:
javax.servlet.ServletException

unload

public void unload()
            throws javax.servlet.ServletException
Specified by:
unload in interface org.apache.catalina.Wrapper
Overrides:
unload in class org.apache.catalina.core.StandardWrapper
Throws:
javax.servlet.ServletException

addValve

public void addValve(org.glassfish.web.valve.GlassFishValve valve)
Specified by:
addValve in interface org.apache.catalina.Pipeline
Overrides:
addValve in class org.apache.catalina.core.StandardWrapper

getWebModule

public com.sun.enterprise.web.WebModule getWebModule()


Copyright © 2012 GlassFish Community. All Rights Reserved.