public class ServerModel extends Object implements BatchVisitor, org.osgi.service.http.runtime.HttpServiceRuntime, ReportViewPlugin
Holds web elements in a global context accross all services (all bundles using the Http Service).
This model represents entire web server and holds all web components (servlets, filters, mappings, ...) for
quick access. This allows to resolve conflicts, when e.g., two different bundles (by default operating on separate
contexts (OSGi contexts like HttpContext, not Servlet contexts)) want to register servlets using
the same alias / URL mapping.
| Constructor and Description |
|---|
ServerModel(Executor executor)
Creates new global model of all web applications with
Executor to be used for configuration and
registration tasks. |
ServerModel(Executor executor,
long threadId)
Creates new global model of all web applications with
Executor to be used for configuration and
registration tasks and thread id specified for checking if tasks run with this (assumed) single thread
executor |
| Modifier and Type | Method and Description |
|---|---|
void |
addContainerInitializerModel(ContainerInitializerModel model,
Batch batch) |
void |
addErrorPageModel(ErrorPageModel model,
Batch batch) |
void |
addEventListenerModel(EventListenerModel model,
Batch batch) |
void |
addFilterModel(FilterModel model,
Batch batch)
Validates
FilterModel and adds relevant batch operations if validation is successful. |
void |
addServletModel(ServletModel model,
Batch batch)
Validates
ServletModel and adds relevant batch operations if validation is successful. |
void |
addWebSocketModel(WebSocketModel model,
Batch batch) |
void |
addWelcomeFileModel(WelcomeFileModel model,
Batch batch) |
void |
addWhiteboardContext(OsgiContextModel ocm) |
void |
associateHttpContext(org.ops4j.pax.web.service.WebContainerContext context,
OsgiContextModel osgiContextModel)
Mark
WebContainerContext as the owner/creator/initiator of given OsgiContextModel
whether it's shared or bundle-scoped. |
org.osgi.service.http.runtime.dto.RequestInfoDTO |
calculateRequestInfoDTO(String path) |
void |
collectServlets(Set<ServletInfo> servlets)
Fill information about available servlets
|
void |
collectWebApplications(Set<WebApplicationInfo> webapps)
This method is called to fill a list of
web application models for reporting
purpose. |
OsgiContextModel |
createDefaultSharedtHttpContext(String contextId,
ServerController controller)
Creates named
OsgiContextModel as shared OsgiContextModel. |
ContainerInitializerModel |
createJSPServletContainerInitializerModel(org.osgi.framework.Bundle serviceBundle) |
ServletModel |
createJspServletModel(org.osgi.framework.Bundle serviceBundle,
String name,
String jspFile,
String[] urlPatterns,
Map<String,String> initParams,
JspConfiguration config)
Method that creates
ServletModel to be called when actually registering JSP support within
a HttpContext / OsgiContextModel, but also called when needed during registration of a servlet
backed by "JSP file". |
OsgiContextModel |
createNewContextModel(org.ops4j.pax.web.service.WebContainerContext webContext,
org.osgi.framework.Bundle serviceBundle,
String contextPath)
Method used to create new instance of
OsgiContextModel when the input
WebContainerContext is not yet associated with any context. |
void |
deassociateContexts(org.osgi.framework.Bundle bundle,
ServerController controller)
Method to be called when bundle-scoped
WebContainer instance is stopped (usually when the bundle for
which the bundle-scoped WebContainer service was obtained is stopped). |
void |
disassociateHttpContext(org.ops4j.pax.web.service.WebContainerContext context,
OsgiContextModel osgiContextModel)
Simply unmark
WebContainerContext as the owner/creator/initiator of given OsgiContextModel
whether it's shared or bundle-related. |
List<OsgiContextModel> |
getAllBundleOsgiContextModels(org.osgi.framework.Bundle bundle) |
Set<OsgiContextModel> |
getAllWhiteboardContexts() |
OsgiContextModel |
getBundleContextModel(org.ops4j.pax.web.service.WebContainerContext context)
Returns (if exists) bundle-scoped
OsgiContextModel for given WebContainerContext. |
OsgiContextModel |
getBundleContextModel(org.ops4j.pax.web.service.WebContainerContext context,
OsgiContextModel skip)
Gets the best bundle
OsgiContextModel for given WebContainerContext unless it's the one
to skip |
OsgiContextModel |
getBundleDefaultContextModel(ContextKey key) |
Collection<ContainerInitializerModel> |
getContainerInitializerModels() |
OsgiContextModel |
getContextModel(String name,
org.osgi.framework.Bundle ownerBundle)
Returns (if exists) bundle-scoped
OsgiContextModel with given name. |
Set<ServletModel> |
getDisabledServletModels() |
Set<WebSocketModel> |
getDisabledWebSocketModels() |
Executor |
getExecutor() |
Set<ElementModel<?,?>> |
getFailedWhiteboardElements() |
org.osgi.framework.dto.ServiceReferenceDTO |
getHttpServiceRuntimeDTO() |
org.osgi.framework.ServiceRegistration<org.osgi.service.http.runtime.HttpServiceRuntime> |
getHttpServiceRuntimeReg() |
OsgiContextModel |
getOrCreateOsgiContextModel(org.ops4j.pax.web.service.WebContainerContext context,
org.osgi.framework.Bundle serviceBundle,
String contextPath,
Batch batch)
Returns (new or existing)
OsgiContextModel associated with HttpContext. |
ServletContextModel |
getOrCreateServletContextModel(String contextPath,
Batch batch)
Returns
ServletContextModel uniquely identified by context path (as defined by
ServletContext.getContextPath(). |
List<OsgiContextModel> |
getOsgiContextModels(org.osgi.framework.Bundle bundle)
Returns
OsgiContextModel contexts that can be used by given bundle - i.e., can be targets of
Whiteboard web element registered withing given bundle. |
org.osgi.service.http.runtime.dto.RuntimeDTO |
getRuntimeDTO() |
ServletContextModel |
getServletContextModel(String contextPath)
Simply returns a
ServletContextModel for given contextPath |
OsgiContextModel |
getSharedContextModel(String name)
Returns (if exists) bundle-agnostic (shared)
OsgiContextModel |
OsgiContextModel |
getSharedContextModel(String name,
OsgiContextModel skip)
Gets the best shared
OsgiContextModel for given name unless it's the one to skip |
OsgiContextModel |
getSharedDefaultContextModel(String name) |
static long |
getThreadIdFromSingleThreadPool(Executor executor) |
OsgiContextModel |
getWabContext(String contextPath,
org.osgi.framework.Bundle wab,
boolean create)
When dealing with WABs, before WAB's
OsgiContextModel is available for other registrations
(HttpService and Whiteboard) it has to be allocated - so no two WABs conflict about an OsgiContextModel. |
WebApplicationInfo |
getWebApplication(long bundleId)
Returns information about single WAB (by its bundle id).
|
WebApplicationInfo |
getWebApplication(String contextPath)
Returns information about single WAB (by its context path) - only successully deployed WABs should be returned,
because there may be more failed contexts too.
|
void |
prepareErrorPageSnapshot(Map<String,TreeMap<ErrorPageModel,List<OsgiContextModel>>> currentlyEnabledByPath,
Set<ErrorPageModel> currentlyDisabled,
ErrorPageModel newlyAdded,
Set<ErrorPageModel> newlyDisabled)
Preparation for
reEnableErrorPageModels(Set, Map, ErrorPageModel, Batch) that does
proper copy of current state of all ServletContextModel |
void |
prepareFiltersSnapshot(Map<String,TreeMap<FilterModel,List<OsgiContextModel>>> currentlyEnabledByPath,
Set<FilterModel> currentlyDisabled,
FilterModel newlyAdded,
Set<FilterModel> newlyDisabled)
Preparation for
reEnableFilterModels(Set, Map, FilterModel, Batch) that does
proper copy of current state of all ServletContextModel |
void |
prepareWebSocketsSnapshot(Map<String,Map<String,WebSocketModel>> currentlyEnabledByPath,
Set<WebSocketModel> currentlyDisabled,
WebSocketModel newlyAdded,
Set<WebSocketModel> newlyDisabled)
Preparation for
reEnableWebSocketModels(Set, Map, WebSocketModel, Batch) that does
proper copy of current state of all ServletContextModel |
void |
registerOsgiContextModelIfNeeded(OsgiContextModel contextModel,
ServiceModel serviceModel,
Batch batch)
Ensures that
OsgiContextModel created and managed in pax-web-extender-whiteboard and passed together
with ElementModel is correctly registered in this ServerModel and passed to
ServerController. |
void |
registerReportViewPlugin(ReportViewPlugin plugin) |
void |
registerWabOsgiContextListener(WebContextEventListener listener)
When WABs send their
OsgiContextModel to ServerModel, this should be the only, always-winning
OsgiContextModel used both by the Whiteboard and HttpService web elements. |
void |
releaseWabContext(String contextPath,
org.osgi.framework.Bundle wab)
Free the
OsgiContextModel allocated previously by a WAB. |
void |
removeErrorPageModels(List<ErrorPageModel> models,
Batch batch) |
void |
removeEventListenerModels(List<EventListenerModel> models,
Batch batch) |
void |
removeFilterModels(List<FilterModel> models,
Batch batch) |
void |
removeServletModels(List<ServletModel> models,
Batch batch)
Adds relevant batch operations related to unregistration of
servlet models. |
void |
removeWebSocketModels(List<WebSocketModel> models,
Batch batch) |
void |
removeWelcomeFileModel(WelcomeFileModel model,
Batch batch) |
void |
removeWhiteboardContext(OsgiContextModel ocm) |
<T> T |
run(ModelRegistrationTask<T> task,
boolean asynchronous)
Utility method of the global
ServerModel to ensure serial invocation of configuration/registration
tasks. |
<T> void |
runAsync(ModelRegistrationTask<T> task)
Utility method of the global
ServerModel to allow asynchronous configuration/registration
tasks. |
<T> T |
runSilently(ModelRegistrationTask<T> task,
boolean asynchronous) |
void |
setHttpServiceRuntimeInformation(org.osgi.framework.ServiceRegistration<org.osgi.service.http.runtime.HttpServiceRuntime> httpServiceRuntimeReg,
org.osgi.framework.dto.ServiceReferenceDTO httpServiceRuntimeDTO)
Set the "template"
ServiceReferenceDTO for the associated HttpServiceRuntime registration. |
void |
setStopping() |
void |
unregisterOsgiContextModel(OsgiContextModel contextModel,
ServiceModel serviceModel,
Batch batch)
Called through
WhiteboardWebContainerView when the
OsgiContextModel managed in pax-web-extender-whiteboard should be removed from the target
ServerController and unassociated from any bundle. |
void |
unregisterReportViewPlugin(ReportViewPlugin plugin) |
OsgiContextModel |
verifyExistingAssociation(org.ops4j.pax.web.service.WebContainerContext context,
org.osgi.framework.Bundle bundle)
This method ensures that if given
WebContainerContext is already mapped to some
OsgiContextModel, it is permitted to reference it within a scope of a given bundle. |
void |
visitClearDynamicRegistrationsChange(ClearDynamicRegistrationsChange change)
Process a change related to reset of dynamic registrations (like
ServletContext.addServlet(java.lang.String, java.lang.String) |
void |
visitContainerInitializerModelChange(ContainerInitializerModelChange change)
Process a change related to
ContainerInitializerModel |
void |
visitErrorPageModelChange(ErrorPageModelChange change)
Process a change related to error pages
|
void |
visitErrorPageStateChange(ErrorPageStateChange change)
Process full change of the state of error pages per context
|
void |
visitEventListenerModelChange(EventListenerModelChange change)
Processing a change related to
EventListenerModel |
void |
visitFilterModelChange(FilterModelChange change)
Processing a change related to
FilterModel. |
void |
visitFilterStateChange(FilterStateChange change)
Processing full change of registered filters for all the affected contexts.
|
void |
visitOsgiContextModelChange(OsgiContextModelChange change)
Processing a change related to
OsgiContextModel - a model
that affects one ServletContextModel thought the relation is
not 1:1, but N:1 - many OsgiContextModels may be associated with single ServletContextModel. |
void |
visitServletContextModelChange(ServletContextModelChange change)
Processing the most high-level change - related to
ServletContextModel, which creates (or destroys) entire
context (1:1 with "context path"). |
void |
visitServletModelChange(ServletModelChange change)
Processing a change related to
ServletModel. |
void |
visitWebSocketModelChange(WebSocketModelChange change)
Process a change related to
WebSocketModel |
void |
visitWelcomeFileModelChange(WelcomeFileModelChange change)
Process a change related to welcome files.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitvisitContextMetadataModelChange, visitContextParamsChange, visitContextStartChange, visitContextStopChange, visitMimeAndLocaleMappingChange, visitSecurityConfigChange, visitTransactionStateChangepublic ServerModel(Executor executor)
Executor to be used for configuration and
registration tasks.executor - public static long getThreadIdFromSingleThreadPool(Executor executor)
public Executor getExecutor()
public OsgiContextModel createDefaultSharedtHttpContext(String contextId, ServerController controller)
OsgiContextModel as shared OsgiContextModel.contextId - public <T> T run(ModelRegistrationTask<T> task, boolean asynchronous) throws javax.servlet.ServletException, org.osgi.service.http.NamespaceException
Utility method of the global ServerModel to ensure serial invocation of configuration/registration
tasks. Such tasks can freely manipulate all internal Pax Web Runtime models without a need for
synchronization.
The task is executed by Executor associated with this ServerModel.
T - task - asynchronous - javax.servlet.ServletExceptionorg.osgi.service.http.NamespaceExceptionpublic <T> void runAsync(ModelRegistrationTask<T> task)
Utility method of the global ServerModel to allow asynchronous configuration/registration
tasks. Such tasks can still freely manipulate all internal Pax Web Runtime models without a need for
synchronization. But the invoker doesn't wait for the end of this task
The task is executed by Executor associated with this ServerModel.
task - javax.servlet.ServletExceptionorg.osgi.service.http.NamespaceExceptionpublic void setStopping()
public <T> T runSilently(ModelRegistrationTask<T> task, boolean asynchronous)
public ServletContextModel getOrCreateServletContextModel(String contextPath, Batch batch)
Returns ServletContextModel uniquely identified by context path (as defined by
ServletContext.getContextPath(). There's single instance of ServletContextModel even if
it may be referenced by many OsgiContextModels.
This method doesn't alter the global model, only adds relevant operation to the Batch.
This method is used both in Http Service and Whiteboard Service scenarios because there really has to
be single ServletContextModel per context path.
contextPath - batch - public OsgiContextModel getOrCreateOsgiContextModel(org.ops4j.pax.web.service.WebContainerContext context, org.osgi.framework.Bundle serviceBundle, String contextPath, Batch batch) throws IllegalStateException
Returns (new or existing) OsgiContextModel associated with HttpContext. When the target
OsgiContextModel is already available, validation is performed to check if it can be used with
passed HttpContext. The returned OsgiContextModel is never
OsgiContextModel.DEFAULT_CONTEXT_MODEL, which however may be used as template.
As mentioned in bundleContexts doc, the identity is checked for WebContainerContext
and for "default" contexts (returned from create methods of
WebContainer) this identity is name+bundle (or only name for shared
contexts), but for user-provided contexts it can be anything.
This method doesn't alter the global model, only adds relevant operation to the Batch.
context - serviceBundle - contextPath - batch - IllegalStateException - if there exists incompatible associationpublic void registerOsgiContextModelIfNeeded(OsgiContextModel contextModel, ServiceModel serviceModel, Batch batch)
Ensures that OsgiContextModel created and managed in pax-web-extender-whiteboard and passed together
with ElementModel is correctly registered in this ServerModel and passed to
ServerController.
There is really no need to check if the context was already added/associated, because this method
is only called from WhiteboardWebContainerView and we
control it. It doesn't mean there's no way to break it ;)
contextModel - serviceModel - batch - public void unregisterOsgiContextModel(OsgiContextModel contextModel, ServiceModel serviceModel, Batch batch)
WhiteboardWebContainerView when the
OsgiContextModel managed in pax-web-extender-whiteboard should be removed from the target
ServerController and unassociated from any bundle.contextModel - serviceModel - batch - public OsgiContextModel verifyExistingAssociation(org.ops4j.pax.web.service.WebContainerContext context, org.osgi.framework.Bundle bundle) throws IllegalStateException
This method ensures that if given WebContainerContext is already mapped to some
OsgiContextModel, it is permitted to reference it within a scope of a given bundle.
There are several scenarios, including one where HttpService, scoped to
one bundle is used to register a servlet, while passed HttpContext is scoped to another bundle.
With whiteboard approach, user can't trick the runtime with two different bundles (one from the passed
HttpContext and other - from the bundle scoped HttpService because
it's designed much better.
context - existing extension of HttpContext, probably created from bundle-scoped
HttpServicebundle - actual bundle on behalf of each we try to perform a registration of web element - comes from
the scope of HttpService through which the registration is made.OsgiContextModel is returned. null
is returned if the association is possibleIllegalStateException - if there exists incompatible associationpublic OsgiContextModel createNewContextModel(org.ops4j.pax.web.service.WebContainerContext webContext, org.osgi.framework.Bundle serviceBundle, String contextPath)
Method used to create new instance of OsgiContextModel when the input
WebContainerContext is not yet associated with any context.
Dedicated method for this purpose emphasizes the importance and fragility of OsgiContextModel.
The only other way to create OsgiContextModel is the Whiteboard approach, when user registers one
of these OSGi services:
ServletContextHelper with service registration parametersHttpContext with service registration parameters - not recommendedServletContextHelperMapping - Pax Web WhiteboardHttpContextMapping - Pax Web WhiteboardThe above Whiteboard methods allow to specify (service registration parameters or direct
values in ContextMapping) additional information about
OsgiContextModel:
OsgiContextModel is used only
for Http Service scenario.webContext - serviceBundle - contextPath - public void associateHttpContext(org.ops4j.pax.web.service.WebContainerContext context,
OsgiContextModel osgiContextModel)
Mark WebContainerContext as the owner/creator/initiator of given OsgiContextModel
whether it's shared or bundle-scoped.
public void disassociateHttpContext(org.ops4j.pax.web.service.WebContainerContext context,
OsgiContextModel osgiContextModel)
Simply unmark WebContainerContext as the owner/creator/initiator of given OsgiContextModel
whether it's shared or bundle-related.
public OsgiContextModel getContextModel(String name, org.osgi.framework.Bundle ownerBundle)
OsgiContextModel with given name. This method retrieves only
"default" contexts created via HttpService.createDefaultHttpContext().name - ownerBundle - public OsgiContextModel getBundleContextModel(org.ops4j.pax.web.service.WebContainerContext context)
OsgiContextModel for given WebContainerContext. This
method can retrieve all the contexts - even ones created for entirely custom implementations of
HttpContext interface.context - public OsgiContextModel getBundleContextModel(org.ops4j.pax.web.service.WebContainerContext context, OsgiContextModel skip)
OsgiContextModel for given WebContainerContext unless it's the one
to skipcontext - skip - public OsgiContextModel getBundleDefaultContextModel(ContextKey key)
public OsgiContextModel getSharedContextModel(String name)
OsgiContextModelname - public OsgiContextModel getSharedContextModel(String name, OsgiContextModel skip)
OsgiContextModel for given name unless it's the one to skipname - skip - public OsgiContextModel getSharedDefaultContextModel(String name)
public List<OsgiContextModel> getOsgiContextModels(org.osgi.framework.Bundle bundle)
Returns OsgiContextModel contexts that can be used by given bundle - i.e., can be targets of
Whiteboard web element registered withing given bundle.
None of the returned contexts will have a registration property named
HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_NAME because they should match LDAP filters with
HttpWhiteboardConstants.HTTP_SERVICE_CONTEXT_PROPERTY property only.
This method is used during Whiteboard registration of web elements to get the highest ranked bundle-scoped
OsgiContextModel. It doesn't return all context models for given bundle
bundle - public List<OsgiContextModel> getAllBundleOsgiContextModels(org.osgi.framework.Bundle bundle)
public void deassociateContexts(org.osgi.framework.Bundle bundle,
ServerController controller)
WebContainer instance is stopped (usually when the bundle for
which the bundle-scoped WebContainer service was obtained is stopped). All contexts should be removed
from the ServerModel. Also they should be removed from backend ServerController.bundle - public OsgiContextModel getWabContext(String contextPath, org.osgi.framework.Bundle wab, boolean create)
OsgiContextModel is available for other registrations
(HttpService and Whiteboard) it has to be allocated - so no two WABs conflict about an OsgiContextModel.
Allocated OsgiContextModel can later be handled in visitOsgiContextModelChange(org.ops4j.pax.web.service.spi.task.OsgiContextModelChange) and when
it's deallocated, awaiting WABs are informed that they can proceed with registration.contextPath - wab - create - public void releaseWabContext(String contextPath, org.osgi.framework.Bundle wab)
OsgiContextModel allocated previously by a WAB.contextPath - wab - public ServletContextModel getServletContextModel(String contextPath)
ServletContextModel for given contextPathcontextPath - public void registerWabOsgiContextListener(WebContextEventListener listener)
When WABs send their OsgiContextModel to ServerModel, this should be the only, always-winning
OsgiContextModel used both by the Whiteboard and HttpService web elements. This method allows
pax-web-extender-whiteboard to register a callback that can be informed about new OsgiContextModel
being registered for a WAB - pax-web-extender-whiteboard can then decide to re-register relevant Whiteboard
elements to new context.
For HttpService scenario, when HttpService.registerServlet(java.lang.String, javax.servlet.Servlet, java.util.Dictionary<?, ?>, org.osgi.service.http.HttpContext) is called first and then WAB is installed,
the existing servlet is
listener - public void addServletModel(ServletModel model, Batch batch) throws org.osgi.service.http.NamespaceException, javax.servlet.ServletException
ServletModel and adds relevant batch operations if validation is successful. Due to
complexity of specification, simple "registration of servlet" may cause unregistration of one or more
existing servlets, when current registration uses existing URL mapping, but has higher ranking.model - servlet model to register with all associated OsgiContextModel neededbatch - org.osgi.service.http.NamespaceException - if servlet alias is already registered (assuming the servlet was registered for
an "alias")javax.servlet.ServletException - if servlet is already registeredIllegalStateException - if anything goes wrongIllegalArgumentException - if validation failspublic void removeServletModels(List<ServletModel> models, Batch batch)
servlet models. Due to
complexity of specification, simple "unregistration of servlet" may cause registration of one or more
existing, but currently disabled servlets.models - servlet models to unregister from all associated OsgiContextModelbatch - IllegalStateException - if anything goes wrongpublic Set<ServletModel> getDisabledServletModels()
public Collection<ContainerInitializerModel> getContainerInitializerModels()
public Set<WebSocketModel> getDisabledWebSocketModels()
public void addFilterModel(FilterModel model, Batch batch) throws javax.servlet.ServletException
Validates FilterModel and adds relevant batch operations if validation is successful.
Handling filters is a bit different, because each added filter may have to be added in particular order (probably in-between some existing filters), so the changes are added into batch as one step.
model - filter model to register with all associated OsgiContextModel neededbatch - javax.servlet.ServletExceptionIllegalStateException - if anything goes wrongIllegalArgumentException - if validation failspublic void removeFilterModels(List<FilterModel> models, Batch batch)
public void prepareFiltersSnapshot(Map<String,TreeMap<FilterModel,List<OsgiContextModel>>> currentlyEnabledByPath, Set<FilterModel> currentlyDisabled, FilterModel newlyAdded, Set<FilterModel> newlyDisabled)
reEnableFilterModels(Set, Map, FilterModel, Batch) that does
proper copy of current state of all ServletContextModelcurrentlyEnabledByPath - currentlyDisabled - newlyAdded - prepared snapshot will include newly added model as currentlyDisabled
(to enable it potentially)newlyDisabled - prepared snapshot will already have newlyDisabled models removed from snapshot mappingspublic void addEventListenerModel(EventListenerModel model, Batch batch)
public void removeEventListenerModels(List<EventListenerModel> models, Batch batch)
public void addContainerInitializerModel(ContainerInitializerModel model, Batch batch)
public void addWelcomeFileModel(WelcomeFileModel model, Batch batch)
public void removeWelcomeFileModel(WelcomeFileModel model, Batch batch)
public void addErrorPageModel(ErrorPageModel model, Batch batch)
public void removeErrorPageModels(List<ErrorPageModel> models, Batch batch)
public void prepareErrorPageSnapshot(Map<String,TreeMap<ErrorPageModel,List<OsgiContextModel>>> currentlyEnabledByPath, Set<ErrorPageModel> currentlyDisabled, ErrorPageModel newlyAdded, Set<ErrorPageModel> newlyDisabled)
reEnableErrorPageModels(Set, Map, ErrorPageModel, Batch) that does
proper copy of current state of all ServletContextModelcurrentlyEnabledByPath - currentlyDisabled - newlyAdded - prepared snapshot will include newly added model as currentlyDisabled
(to enable it potentially)newlyDisabled - prepared snapshot will already have newlyDisabled models removed from snapshot mappingspublic ServletModel createJspServletModel(org.osgi.framework.Bundle serviceBundle, String name, String jspFile, String[] urlPatterns, Map<String,String> initParams, JspConfiguration config)
ServletModel to be called when actually registering JSP support within
a HttpContext / OsgiContextModel, but also called when needed during registration of a servlet
backed by "JSP file".serviceBundle - name - jspFile - urlPatterns - initParams - public ContainerInitializerModel createJSPServletContainerInitializerModel(org.osgi.framework.Bundle serviceBundle)
public void addWebSocketModel(WebSocketModel model, Batch batch)
public void removeWebSocketModels(List<WebSocketModel> models, Batch batch)
public void prepareWebSocketsSnapshot(Map<String,Map<String,WebSocketModel>> currentlyEnabledByPath, Set<WebSocketModel> currentlyDisabled, WebSocketModel newlyAdded, Set<WebSocketModel> newlyDisabled)
reEnableWebSocketModels(Set, Map, WebSocketModel, Batch) that does
proper copy of current state of all ServletContextModelcurrentlyEnabledByPath - currentlyDisabled - newlyAdded - prepared snapshot will include newly added model as currentlyDisabled
(to enable it potentially)newlyDisabled - prepared snapshot will already have newlyDisabled models removed from snapshot mappingspublic void visitServletContextModelChange(ServletContextModelChange change)
BatchVisitorServletContextModel, which creates (or destroys) entire
context (1:1 with "context path").visitServletContextModelChange in interface BatchVisitorpublic void visitOsgiContextModelChange(OsgiContextModelChange change)
BatchVisitorOsgiContextModel - a model
that affects one ServletContextModel thought the relation is
not 1:1, but N:1 - many OsgiContextModels may be associated with single ServletContextModel.visitOsgiContextModelChange in interface BatchVisitorpublic void visitServletModelChange(ServletModelChange change)
BatchVisitorServletModel. Related
to registration or unregistration of servlets.visitServletModelChange in interface BatchVisitorpublic void visitFilterModelChange(FilterModelChange change)
BatchVisitorFilterModel. Related
to registration or unregistration of filter.visitFilterModelChange in interface BatchVisitorpublic void visitFilterStateChange(FilterStateChange change)
BatchVisitorvisitFilterStateChange in interface BatchVisitorpublic void visitEventListenerModelChange(EventListenerModelChange change)
BatchVisitorEventListenerModelvisitEventListenerModelChange in interface BatchVisitorpublic void visitWelcomeFileModelChange(WelcomeFileModelChange change)
BatchVisitorvisitWelcomeFileModelChange in interface BatchVisitorpublic void visitErrorPageModelChange(ErrorPageModelChange change)
BatchVisitorvisitErrorPageModelChange in interface BatchVisitorpublic void visitErrorPageStateChange(ErrorPageStateChange change)
BatchVisitorvisitErrorPageStateChange in interface BatchVisitorpublic void visitContainerInitializerModelChange(ContainerInitializerModelChange change)
BatchVisitorContainerInitializerModelvisitContainerInitializerModelChange in interface BatchVisitorpublic void visitWebSocketModelChange(WebSocketModelChange change)
BatchVisitorWebSocketModelvisitWebSocketModelChange in interface BatchVisitorpublic void visitClearDynamicRegistrationsChange(ClearDynamicRegistrationsChange change)
BatchVisitorServletContext.addServlet(java.lang.String, java.lang.String)visitClearDynamicRegistrationsChange in interface BatchVisitorpublic org.osgi.service.http.runtime.dto.RuntimeDTO getRuntimeDTO()
getRuntimeDTO in interface org.osgi.service.http.runtime.HttpServiceRuntimepublic org.osgi.service.http.runtime.dto.RequestInfoDTO calculateRequestInfoDTO(String path)
calculateRequestInfoDTO in interface org.osgi.service.http.runtime.HttpServiceRuntimepublic void collectWebApplications(Set<WebApplicationInfo> webapps)
ReportViewPluginweb application models for reporting
purpose. It is the responsibility of the implementation to check (by some kind of key) if the
WebApplicationInfo is already in the passed set - in this case, the existing model can be updated
instead.collectWebApplications in interface ReportViewPluginpublic WebApplicationInfo getWebApplication(String contextPath)
ReportViewPlugingetWebApplication in interface ReportViewPluginpublic WebApplicationInfo getWebApplication(long bundleId)
ReportViewPlugingetWebApplication in interface ReportViewPluginpublic void collectServlets(Set<ServletInfo> servlets)
ReportViewPlugincollectServlets in interface ReportViewPluginpublic void registerReportViewPlugin(ReportViewPlugin plugin)
public void unregisterReportViewPlugin(ReportViewPlugin plugin)
public void setHttpServiceRuntimeInformation(org.osgi.framework.ServiceRegistration<org.osgi.service.http.runtime.HttpServiceRuntime> httpServiceRuntimeReg,
org.osgi.framework.dto.ServiceReferenceDTO httpServiceRuntimeDTO)
ServiceReferenceDTO for the associated HttpServiceRuntime registration.
It should be set initially after ServerModel is created and HttpServiceRuntime is registered.httpServiceRuntimeReg - httpServiceRuntimeDTO - public org.osgi.framework.ServiceRegistration<org.osgi.service.http.runtime.HttpServiceRuntime> getHttpServiceRuntimeReg()
public org.osgi.framework.dto.ServiceReferenceDTO getHttpServiceRuntimeDTO()
public Set<OsgiContextModel> getAllWhiteboardContexts()
public void addWhiteboardContext(OsgiContextModel ocm)
public void removeWhiteboardContext(OsgiContextModel ocm)
public Set<ElementModel<?,?>> getFailedWhiteboardElements()
Copyright © 2006–2024 OPS4J - Open Participation Software for Java. All rights reserved.