Package org.osgi.framework

Examples of org.osgi.framework.ServiceException


        HttpService httpService = getHttpService();
        try {
            httpService.registerServlet(contextRoot, cxf, new Hashtable<String, String>(), null);
            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) serviceReference.getProperty(Constants.WS_DATABINDING_PROP_KEY);
        if("jaxb".equals(dataBindingImpl)) {
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 {
            httpService.registerServlet(contextRoot, cxf, new Hashtable<String, String>(), null);
            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 (ref != null) {
          service = _bundleContext.getService(ref);
      }
     
      if (service == null) {
          throw new ManagementException(new ServiceException(type.getName(), ServiceException.UNREGISTERED));
      }
     
      return type.cast(service);
  }
View Full Code Here

        cxf.setBus(cxfBus);
        try {
            httpService.registerServlet(CONTEXT_ROOT, cxf, new Hashtable<String, String>(),
                httpService.createDefaultHttpContext());
        } catch (Exception e) {
            throw new ServiceException("CXF: problem registering CXF HTTP Servlet", e);
        }
    }
View Full Code Here

    ClassLoader cl = getProxyClassLoader(requestingBundle);
    try {
      return remoteService.getProxy(cl, (Class[]) serviceInterfaceClasses
          .toArray(new Class[serviceInterfaceClasses.size()]));
    } catch (ECFException e) {
      throw new ServiceException(
          "ProxyServiceFactory cannot create proxy for clientBundle=" //$NON-NLS-1$
              + bundleSymbolicName + " from serviceReference=" //$NON-NLS-1$
              + serviceReference, e);
    }
View Full Code Here

    // By default we throw a runtime exception, but
    // only throw an exception if not explicitly turned off
    if (!(exception instanceof NotSerializableException)
        || !ignoreSerializationExceptions) {
      logError(exceptionMessage, exception);
      throw new ServiceException(exceptionMessage, exception);
    } else {
      logWarning(exceptionMessage, exception);
    }
  }
View Full Code Here

        if (this.serverIps.size() != 1) {
          String msg = "ZooDiscovery property "
              + ZOODISCOVERY_FLAVOR_CENTRALIZED
              + " must contain exactly one IP address designating the location of the ZooDiscovery instance playing this central role.";
          Logger.log(LogService.LOG_ERROR, msg, null);
          throw new ServiceException(msg);
        }

      } else if (getConfigProperties().containsKey(
          ZOODISCOVERY_FLAVOR_REPLICATED)) {
        this.setFlavor(FLAVOR.REPLICATED);
        this.serverIps = parseIps();
        if (!this.serverIps.contains(Geo.getHost())) {
          this.serverIps.add(Geo.getHost());
        }
        if (this.serverIps.size() < 2) {
          String msg = "Industrial Discovery property "//$NON-NLS-1$
              + IDiscoveryConfig.ZOODISCOVERY_FLAVOR_REPLICATED
              + " must contain at least one IP address which is not localhost.";
          Logger.log(LogService.LOG_ERROR, msg, null);
          throw new ServiceException(msg);
        }

      } else if (getConfigProperties().containsKey(
          ZOODISCOVERY_FLAVOR_STANDALONE)) {
        this.setFlavor(FLAVOR.STANDALONE);
View Full Code Here

  }

  public IFuture callAsync(final IRemoteCall call) {
    IExecutor executor = getIFutureExecutor(call);
    if (executor == null)
      throw new ServiceException("iFuture executor is null.  Cannot callAsync remote method=" + call.getMethod()); //$NON-NLS-1$
    return executor.execute(new IProgressRunnable() {
      public Object run(IProgressMonitor monitor) throws Exception {
        return callSync(call);
      }
    }, null);
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.