HttpContext context = httpService.createDefaultHttpContext(); try { LOG.log(Level.INFO, "Registering new instance of \"" + alias + "\" servlet");
/** * Creates a {@link HttpContext} * * @return a {@link HttpContext} */ protected HttpContext createHttpContext() { HttpContext defaultHttpContext = httpService.createDefaultHttpContext(); return defaultHttpContext; }
/** * Creates an {@link HttpContext}. * * @return an {@link HttpContext} that grants anonymous access */ protected HttpContext createHttpContext() { // TODO: Once we have a role-based permission system in place, we need to make sure that we create an // HttpContext here, which allows accessing the servlet without any authentication. HttpContext httpContext = httpService.createDefaultHttpContext(); return httpContext; }
/** * Creates a {@link HttpContext} * * @return a {@link HttpContext} */ protected HttpContext createHttpContext() { return httpService.createDefaultHttpContext(); }
/** * Initializes this context * * @param httpService The parent HTTP service */ public XOWLMainHTTPContext(HttpService httpService) { this.delegate = httpService.createDefaultHttpContext(); }
/** * Creates a {@link HttpContext} * * @return a {@link HttpContext} */ protected HttpContext createHttpContext() { HttpContext defaultHttpContext = httpService.createDefaultHttpContext(); return defaultHttpContext; }
/** * Creates a {@link HttpContext} * * @return a {@link HttpContext} */ protected HttpContext createHttpContext() { return httpService.createDefaultHttpContext(); }
protected void setHttpService(HttpService httpService) { this.httpService = httpService; this.defaultHttpContext = httpService.createDefaultHttpContext(); }
void init(HttpService service) { context = service.createDefaultHttpContext(); }
OsgiManagerHttpContext( HttpService httpService, final ServiceTracker tracker, final String username, final String password, final String realm ) { this.tracker = tracker; this.username = username; this.password = new Password(password); this.realm = realm; this.base = httpService.createDefaultHttpContext(); }
OsgiManagerHttpContext( HttpService httpService, final ServiceTracker tracker, final String username, final String password, final String realm ) { this.tracker = tracker; this.username = username; this.password = new Password(password); this.realm = realm; this.base = httpService.createDefaultHttpContext(); }
/** * Initialize this context * * @param httpService The HTTP service */ public XOWLHttpContext(HttpService httpService) { this.defaultContext = httpService.createDefaultHttpContext(); this.root = new Folder(); }
@Reference protected void setHttpService(HttpService httpService) { try { httpService.registerServlet(IMAGES_ALIAS, this, null, httpService.createDefaultHttpContext()); } catch (Exception e) { logger.error("Could not register icon forwarder servlet: {}", e.getMessage()); } }
public void registerServlet(BundleContext bundleContext) throws Exception { HttpContext defaultHttpContext = httpService.createDefaultHttpContext(); Dictionary<String,String> servletParam = new Hashtable<String,String>(2); servletParam.put("-webAllowOthers", ""); httpService.registerServlet("/dbconsole", new WebServlet(), servletParam, defaultHttpContext); }
public void register() throws Exception { ObjectHelper.notEmpty(alias, "alias", this); ObjectHelper.notEmpty(servletName, "servletName", this); HttpContext actualHttpContext = (httpContext == null) ? httpService.createDefaultHttpContext() : httpContext; final Dictionary<String, String> initParams = new Hashtable<>(); initParams.put("matchOnUriPrefix", matchOnUriPrefix ? "true" : "false"); initParams.put("servlet-name", servletName); httpService.registerServlet(alias, servlet, initParams, actualHttpContext); alreadyRegistered = true; }
@Override public void afterPropertiesSet() throws Exception { HttpContext actualHttpContext = (httpContext == null) ? httpService.createDefaultHttpContext() : httpContext; final Dictionary<String, String> initParams = new Hashtable<String, String>(); // The servlet will always have to match on uri prefix as some endpoints may do so initParams.put("matchOnUriPrefix", "true"); try { String servletName = servlet.getServletName(); initParams.put("servlet-name", servletName); } catch (Exception e) { // If getServletName is not implemented the default is to throw an exception // In this case we simply do not set a servlet name } httpService.registerServlet(alias, servlet, initParams, actualHttpContext); alreadyRegistered = true; }
@Activate void activate(ComponentContext context, Map<String, ?> properties) { try { FabricDiscoveryServlet discoveryServlet = new FabricDiscoveryServlet(); discoveryServlet.setCurator(curator.get()); HttpContext base = httpService.get().createDefaultHttpContext(); httpService.get().registerServlet("/mq-discovery", discoveryServlet, createParams("mq-discovery"), base); } catch (Throwable t) { LOGGER.warn("Failed to register fabric maven proxy servlets, due to:" + t.getMessage()); } activateComponent(); }
@Activate void activate(ComponentContext context, Map<String, ?> properties) { try { FabricDiscoveryServlet discoveryServlet = new FabricDiscoveryServlet(); discoveryServlet.setCurator(curator.get()); HttpContext base = httpService.get().createDefaultHttpContext(); httpService.get().registerServlet("/mq-discovery", discoveryServlet, createParams("mq-discovery"), base); } catch (Throwable t) { LOGGER.warn("Failed to register fabric maven proxy servlets, due to:" + t.getMessage()); } activateComponent(); }
private void startThriftHttpAuthenticatorService(ThriftAuthenticatorService thriftAuthenticatorService) { // servlet based authenticator service for authentication for now. try { AuthenticatorService.Processor authServiceProcessor = new AuthenticatorService.Processor(new AuthenticatorServiceImpl(thriftAuthenticatorService)); TCompactProtocol.Factory inProtFactory = new TCompactProtocol.Factory(); TCompactProtocol.Factory outProtFactory = new TCompactProtocol.Factory(); getHttpServiceInstance().registerServlet("/thriftAuthenticator", new AuthenticatorServlet(authServiceProcessor, inProtFactory, outProtFactory), new Hashtable(), getHttpServiceInstance().createDefaultHttpContext()); } catch (ServletException e) { log.error("Unable to start Thrift Authenticator Service." + e); } catch (NamespaceException e) { log.error("Unable to start Thrift Authenticator Service" + e); } }
private void startThriftHttpAuthenticatorService(ThriftAuthenticatorService thriftAuthenticatorService) { // servlet based authenticator service for authentication for now. try { AuthenticatorService.Processor authServiceProcessor = new AuthenticatorService.Processor(new AuthenticatorServiceImpl(thriftAuthenticatorService)); TCompactProtocol.Factory inProtFactory = new TCompactProtocol.Factory(); TCompactProtocol.Factory outProtFactory = new TCompactProtocol.Factory(); getHttpServiceInstance().registerServlet("/thriftAuthenticator", new AuthenticatorServlet(authServiceProcessor, inProtFactory, outProtFactory), new Hashtable(), getHttpServiceInstance().createDefaultHttpContext()); } catch (ServletException e) { log.error("Unable to start Thrift Authenticator Service." + e); } catch (NamespaceException e) { log.error("Unable to start Thrift Authenticator Service" + e); } }