Package org.osgi.service.http

Examples of org.osgi.service.http.HttpService.unregister()


  public void stop(BundleContext context) throws Exception {
    HttpService service = (HttpService)context
      .getService(context.getServiceReference(HttpService.class.getName()));

    service.unregister("/Add");
    service.unregister("/List");
  }

}
View Full Code Here


        String servletAlias = getRuntimeAwareAlias("/httpsrv/servlet");
        httpService.registerServlet(servletAlias, new HttpServiceServlet(module), null, null);
        Assert.assertEquals("http-service:1.0.0", performCall(reqspec));

        // Unregister the servlet alias
        httpService.unregister(servletAlias);
        assertNotAvailable(reqspec);

        // Verify that the alias is not available any more
        assertNotAvailable(reqspec);
    }
View Full Code Here

            String servletAlias = getRuntimeAwareAlias("/httpsrv/servlet");
            httpService.registerServlet(servletAlias, new HttpServiceServlet(module), null, null);
            Assert.assertEquals("http-service:1.0.0", performCall(reqspec));

            // Unregister the servlet alias
            httpService.unregister(servletAlias);
            assertNotAvailable(reqspec);

            // Verify that the alias is not available any more
            assertNotAvailable(reqspec);
        } finally {
View Full Code Here

        }

        @Override
        public void removedService(ServiceReference<HttpService> reference, HttpService service) {
            HttpService httpService = context.getService(reference);
            httpService.unregister(EchoServlet.ALIAS);
            super.removedService(reference, service);
        }

    }
}
View Full Code Here

    }

    @SuppressWarnings("unchecked")
  public void removedService(ServiceReference reference, Object service) {
        HttpService httpService = (HttpService) service;
        httpService.unregister(path);

        super.removedService(reference, service);
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.