コード例 #1
0
  @Override
  public <T> Set<Method> getInitializerMethods(Class<T> clazz) throws MultiException {
    Collector collector = new Collector();

    Set<Method> retVal = Utilities.findInitializerMethods(clazz, locator, collector);

    collector.throwIfErrors();

    return retVal;
  }
コード例 #2
0
  @Override
  public <T> Method getPreDestroyMethod(Class<T> clazz) throws MultiException {
    Collector collector = new Collector();

    Method retVal = Utilities.findPreDestroy(clazz, locator, collector);

    collector.throwIfErrors();

    return retVal;
  }
コード例 #3
0
  @SuppressWarnings("unchecked")
  @Override
  public <T> Constructor<T> getConstructor(Class<T> clazz)
      throws MultiException, NoSuchMethodException {
    Collector collector = new Collector();

    Constructor<T> retVal =
        (Constructor<T>) Utilities.findProducerConstructor(clazz, locator, collector);

    try {
      collector.throwIfErrors();
    } catch (MultiException me) {
      for (Throwable th : me.getErrors()) {
        if (th instanceof NoSuchMethodException) {
          throw (NoSuchMethodException) th;
        }
      }

      throw me;
    }

    return retVal;
  }