use of org.apache.felix.http.base.internal.handler.ServletHandler in project felix by apache.
the class SharedHttpServiceImpl method unregister.
/**
* @see org.osgi.service.http.HttpService#unregister(java.lang.String)
*/
public Servlet unregister(final String alias) {
synchronized (this.aliasMap) {
final ServletHandler handler = this.aliasMap.remove(alias);
if (handler == null) {
throw new IllegalArgumentException("Nothing registered at " + alias);
}
final Servlet s = handler.getServlet();
this.handlerRegistry.getRegistry(handler.getContextServiceId()).unregisterServlet(handler.getServletInfo(), true);
return s;
}
}
use of org.apache.felix.http.base.internal.handler.ServletHandler in project felix by apache.
the class SharedServletContextImpl method getNamedDispatcher.
@Override
public RequestDispatcher getNamedDispatcher(final String name) {
if (name == null) {
return null;
}
final RequestDispatcher dispatcher;
final ServletHandler servletHandler = this.registry.resolveServletByName(name);
if (servletHandler != null) {
final ServletResolution resolution = new ServletResolution();
resolution.handler = servletHandler;
resolution.handlerRegistry = this.registry;
// TODO - what is the path of a named servlet?
final RequestInfo requestInfo = new RequestInfo("", null, null, null);
dispatcher = new RequestDispatcherImpl(resolution, requestInfo);
} else {
dispatcher = null;
}
return dispatcher;
}
Aggregations