Package org.osgi.service.url

Examples of org.osgi.service.url.URLStreamHandlerService


        Assert.assertEquals("Check online manipulator bundle state",
                helper.getBundle("org.apache.felix.ipojo.manipulator.online").getState(),
                Bundle.ACTIVE);

        URLStreamHandlerService svc = helper.getServiceObject(URLStreamHandlerService.class, null);
        Assert.assertNotNull("URL Stream handler exported", svc);
        System.out.println(svc);
    }
View Full Code Here


            private Map<ServiceReference<?>, ServiceRegistration<?>> registrations = new HashMap<>();

            @Override
            protected void addingHandler(String protocol, ServiceReference<URLStreamHandler> sref, final URLStreamHandler handler) {
                URLStreamHandlerService service = new AbstractURLStreamHandlerService() {
                    @Override
                    public URLConnection openConnection(URL url) throws IOException {
                        return new URL(null, url.toExternalForm(), handler).openConnection();
                    }
                };
View Full Code Here

            private Map<ServiceReference<?>, ServiceRegistration<?>> registrations = new HashMap<>();

            @Override
            protected void addingHandler(String protocol, ServiceReference<URLStreamHandler> sref, final URLStreamHandler handler) {
                URLStreamHandlerService service = new AbstractURLStreamHandlerService() {
                    @Override
                    public URLConnection openConnection(URL url) throws IOException {
                        return new URL(null, url.toExternalForm(), handler).openConnection();
                    }
                };
View Full Code Here

            {
                public void serviceChanged(ServiceEvent serviceEvent)
                {
                    ServiceReference reference = serviceEvent.getServiceReference();

                    URLStreamHandlerService service = (URLStreamHandlerService) URLStreamHandlerServiceImpl.this.framework.getSystemBundleContext().getService(reference);
                    UrlStreamHandlerHolder holder = new UrlStreamHandlerHolder(service, (Integer) reference.getProperty(Constants.SERVICE_RANKING));

                    String protocol = (String) serviceEvent.getServiceReference().getProperty(URLConstants.URL_HANDLER_PROTOCOL);
                    Set<UrlStreamHandlerHolder> holders = getUrlStreamHandlerHolders(protocol);
View Full Code Here

    {
        LOGGER.entering(CLASS_NAME, "lookupUrlStreamHandler", protocol);

        Set<UrlStreamHandlerHolder> handlerSet = getUrlStreamHandlerHolders(protocol);

        URLStreamHandlerService handler = handlerSet.iterator().next().getService();

        LOGGER.exiting(CLASS_NAME, "lookupUrlStreamHandler", handler);

        return handler;
    }
View Full Code Here

            private Map<ServiceReference<?>, ServiceRegistration<?>> registrations = new HashMap<>();

            @Override
            protected void addingHandler(String protocol, ServiceReference<URLStreamHandler> sref, final URLStreamHandler handler) {
                URLStreamHandlerService service = new AbstractURLStreamHandlerService() {
                    @Override
                    public URLConnection openConnection(URL url) throws IOException {
                        return new URL(null, url.toExternalForm(), handler).openConnection();
                    }
                };
View Full Code Here

            private Map<ServiceReference<?>, ServiceRegistration<?>> registrations = new HashMap<>();

            @Override
            protected void addingHandler(String protocol, ServiceReference<URLStreamHandler> sref, final URLStreamHandler handler) {
                URLStreamHandlerService service = new AbstractURLStreamHandlerService() {
                    @Override
                    public URLConnection openConnection(URL url) throws IOException {
                        return new URL(null, url.toExternalForm(), handler).openConnection();
                    }
                };
View Full Code Here

            private Map<ServiceReference<?>, ServiceRegistration<?>> registrations = new HashMap<>();

            @Override
            protected void addingHandler(String protocol, ServiceReference<URLStreamHandler> sref, final URLStreamHandler handler) {
                URLStreamHandlerService service = new AbstractURLStreamHandlerService() {
                    @Override
                    public URLConnection openConnection(URL url) throws IOException {
                        return new URL(null, url.toExternalForm(), handler).openConnection();
                    }
                };
View Full Code Here

        final CountDownLatch latch = new CountDownLatch(1);
        final AtomicReference<URLStreamHandlerService> serviceRef = new AtomicReference<URLStreamHandlerService>();
        ServiceTracker<URLStreamHandlerService, URLStreamHandlerService> tracker = new ServiceTracker<URLStreamHandlerService, URLStreamHandlerService>(bundleContext, URLStreamHandlerService.class, null) {
            @Override
            public URLStreamHandlerService addingService(ServiceReference<URLStreamHandlerService> sref) {
                URLStreamHandlerService service = super.addingService(sref);
                if (srvfilter == null || srvfilter.match(sref)) {
                    serviceRef.set(bundleContext.getService(sref));
                    latch.countDown();
                }
                return service;
View Full Code Here

        updated(props);
    }

    protected void doStart() throws Exception {
        ConfigurationAdmin configurationAdmin = getTrackedService(ConfigurationAdmin.class);
        URLStreamHandlerService mvnUrlHandler = getTrackedService(URLStreamHandlerService.class);

        if (configurationAdmin == null || mvnUrlHandler == null) {
            return;
        }
View Full Code Here

TOP

Related Classes of org.osgi.service.url.URLStreamHandlerService

Copyright © 2018 www.massapicom. 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.