Package org.eclipse.sisu.peaberry

Examples of org.eclipse.sisu.peaberry.ServiceException


          insertService(new OSGiServiceImport<T>(bundleContext, r)); // NOPMD
        }
      }

    } catch (final InvalidSyntaxException e) {
      throw new ServiceException(e); // this should never happen!
    }
  }
View Full Code Here


              try {
                // see if the context has an instance for this binding class
                refs = bundleContext.getServiceReferences(clazzName, filter);
              } catch (final InvalidSyntaxException e) {
                throw new ServiceException(e); // this should never happen!
              }

              if (null != refs && refs.length > 0) {
                // retrieve the existing instance from the registry
                instance = (T) bundleContext.getService(refs[0]);
View Full Code Here

    try {
      // minimize wrapping of exceptions to help with problem determination
      return constructor.newInstance(null == decorator ? service : decorator.decorate(service));
    } catch (final InstantiationException e) {
      // /CLOVER:OFF
      throw new ServiceException(e);
    } catch (final IllegalAccessException e) {
      throw new ServiceException(e);
    } catch (final InvocationTargetException e) {
      throw new ServiceException(e);
      // /CLOVER:ON
    }
  }
View Full Code Here

        try {
          // should we reset and take the next valid service?
          reset = resetTask.call();
        } catch (final Exception e) {
          throw new ServiceException("Exception in resetTask", e);
        }

        if (reset) {
          super.unget(); // balance previous successful get
        }
View Full Code Here

  static <T> Constructor<T> getProxyConstructor(final Class<T> clazz) {
    try {
      // use a different custom classloader for each class-space, to avoid leaks
      return (Constructor<T>) getProxyClass(clazz).getConstructor(Import.class);
    } catch (final LinkageError e) {
      throw new ServiceException(e);
    } catch (final NoSuchMethodException e) {
      // /CLOVER:OFF
      throw new ServiceException(e);
    } catch (final ClassNotFoundException e) {
      throw new ServiceException(e);
      // /CLOVER:ON
    }
  }
View Full Code Here

    }

    try {
      return config.createExecutableExtension(clazzKey);
    } catch (final CoreException e) {
      throw new ServiceException(e);
    }
  }
View Full Code Here

    }

    try {
      return bundle.loadClass(n < 0 ? value : value.substring(0, n));
    } catch (final ClassNotFoundException e) {
      throw new ServiceException(e);
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.sisu.peaberry.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.