Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. snip..
  2. public void start(BundleContext bundleContext) throws Exception {
  3. ServiceReference<?> httpServiceReference = bundleContext.getServiceReference(HttpService.class.getName());
  4. System.out.println("ref: " + httpServiceReference);
  5.  
  6. HttpService httpService = (HttpService) context.getService(httpServiceReference);
  7. System.out.println(httpService.getClass().getName());
  8.  
  9. try {
  10. httpService.registerServlet("testservlet", new MyServlet() , null, null);
  11. } catch (Exception e) {
  12. e.printStackTrace();
  13. }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement