Package org.osgi.framework

Examples of org.osgi.framework.ServiceException


            for (Object o = m_lockedRegsMap.get(reg); (o != null); o = m_lockedRegsMap.get(reg))
            {
                // We don't allow cycles when we call out to the service factory.
                if (o.equals(Thread.currentThread()))
                {
                    throw new ServiceException(
                        "ServiceFactory.getService() resulted in a cycle.",
                        ServiceException.FACTORY_ERROR,
                        null);
                }
View Full Code Here


        try {
            httpService.registerServlet(contextRoot, cxf, new Hashtable<String, String>(),
                                       getHttpContext(dswContext, httpService));
            LOG.info("Successfully registered CXF DOSGi servlet at " + contextRoot);
        } catch (Exception e) {
            throw new ServiceException("CXF DOSGi: problem registering CXF HTTP Servlet", e);
        }
        Bus bus = cxf.getBus();
        DataBinding databinding;
        String dataBindingImpl = (String)exportRegistration.getExportedService()
            .getProperty(Constants.WS_DATABINDING_PROP_KEY);
View Full Code Here

            Object svc = bundleContext.getService(sr);
            if (svc instanceof HttpService) {
                return (HttpService)svc;
            }
        }
        throw new ServiceException("CXF DOSGi: No HTTP Service could be found to publish CXF endpoint in.");
    }
View Full Code Here

        HttpService httpService = getHttpService();
        try {
            HttpContext httpContext = getHttpContext(dswContext, httpService);                                httpService.registerServlet(contextRoot, cxf, new Hashtable<String, String>(),                                         httpContext);
            LOG.info("Successfully registered CXF DOSGi servlet at " + contextRoot);
        } catch (Exception e) {
            throw new ServiceException("CXF DOSGi: problem registering CXF HTTP Servlet", e);
        }
        Bus bus = cxf.getBus();

        JAXRSServerFactoryBean factory = new JAXRSServerFactoryBean();
        factory.setBus(bus);
View Full Code Here

                    }
                }
            }
                       
            throw new InvocationTargetException(
                    new ServiceException(REMOTE_EXCEPTION_TYPE, theCause));
        } finally {
            Thread.currentThread().setContextClassLoader(oldCl);
        }
    }
View Full Code Here

        if (dynamic) pair = findService(ctx, interfaceName, filter);
        else pair = null;
      }
     
      if (pair == null) {
        throw new ServiceException(interfaceName, ServiceException.UNREGISTERED);
      }
     
      try {
        return method.invoke(pair.service, args);
      } catch (InvocationTargetException ite) {
View Full Code Here

    }
   
    public DeploymentMetadataFactory getDeploymentMetadataFactory() throws ManagementException {
        DeploymentMetadataFactory service = (DeploymentMetadataFactory) deploymentFactoryTracker.getService();
        if (service == null) {
            throw new ManagementException(new ServiceException(DeploymentMetadataFactory.class.getName(), ServiceException.UNREGISTERED));          
        }
        return service;
    }
View Full Code Here

    }
   
    public ApplicationMetadataFactory getApplicationMetadataFactory() throws ManagementException {
        ApplicationMetadataFactory service = (ApplicationMetadataFactory) applicationFactoryTracker.getService();
        if (service == null) {
            throw new ManagementException(new ServiceException(ApplicationMetadataFactory.class.getName(), ServiceException.UNREGISTERED));          
        }
        return service;
    }
View Full Code Here

    }
   
    private AriesApplicationManager getAriesApplicationManager() throws ManagementException {
        AriesApplicationManager service = (AriesApplicationManager) applicationManagerTracker.getService();
        if (service == null) {
            throw new ManagementException(new ServiceException(AriesApplicationManager.class.getName(), ServiceException.UNREGISTERED));          
        }
        return service;
    }
View Full Code Here

    @Override
    public Object getService(Bundle bundle, ServiceRegistration serviceRegistration) {
        try {
            return $getResource();
        } catch (ResourceException e) {
            throw new ServiceException("Error creating connection factory", e);
        }
    }
View Full Code Here

TOP

Related Classes of org.osgi.framework.ServiceException

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.