public Object addingService(ServiceReference reference) { HttpService httpService = (HttpService) context.getService(reference); try { httpService.registerResources("/js", "/src-web", null); } catch (NamespaceException e) { e.printStackTrace(); } return null; }
@Override public HttpService addingService(ServiceReference<HttpService> reference) { HttpService service = ExtendedInternalNode.this.bundleContext.getService(reference); try { service.registerServlet("/elasticsearch", ExtendedInternalNode.this.servlet, null, null); } catch (ServletException e) { e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. } catch (NamespaceException e) { e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. } return service; } @Override
@Override public Object addingService(ServiceReference ref) { Object aliasObj = ref.getProperty(ApplicationFactory.ALIAS_NAME); if(aliasObj instanceof String) { String alias = (String) aliasObj; BundleContentHttpContext httpContext = new BundleContentHttpContext(ref.getBundle()); ApplicationFactory factory = (ApplicationFactory) context.getService(ref); ApplicationFactoryServlet servlet = new ApplicationFactoryServlet(factory); try { httpService.registerServlet(alias, servlet, null, httpContext); return alias; } catch (ServletException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (NamespaceException e) { // TODO Auto-generated catch block e.printStackTrace(); } } return null; } @Override
@Override public Object addingService(ServiceReference reference) { HttpService httpService = (HttpService) context.getService(reference); try { httpService.registerResources("/VAADIN", "/VAADIN", new TargetBundleHttpContext(context, "com.vaadin")); } catch (NamespaceException e) { e.printStackTrace(); } ApplicationFactoryTracker bridge = new ApplicationFactoryTracker(httpService, context); bridge.open(); return bridge; } @Override
public HttpService addingService(ServiceReference<HttpService> reference) { final HttpService httpService = (HttpService) bundleContext .getService(reference); if (httpService != null) { // create a default context to share between registrations final HttpContext httpContext = httpService.createDefaultHttpContext(); final Dictionary<String, Object> initParams = new Hashtable<String, Object>(); try { httpService.registerServlet("/hello", new HelloServlet(), initParams, httpContext); httpService.registerServlet("/hello/logo", new HelloImage(), initParams, httpContext); httpService.registerResources("/images", "/images", httpContext); } catch (ServletException e) { e.printStackTrace(); } catch (NamespaceException e) { e.printStackTrace(); } } return httpService; }
e.printStackTrace(); } catch (NamespaceException e) { e.printStackTrace();