Package javax.enterprise.inject

Examples of javax.enterprise.inject.InjectionException


      ClassLoader loader = Thread.currentThread().getContextClassLoader();

      Class<?> serviceClass = Class.forName(className, false, loader);

      if (! serviceApi.isAssignableFrom(serviceClass))
        throw new InjectionException(L.l("'{0}' is not a valid servicebecause it does not implement {1}",
                                         serviceClass, serviceApi.getName()));

      return (Class<T>) serviceClass;
    } catch (Exception e) {
      log.log(Level.WARNING, e.toString(), e);
View Full Code Here


      InjectionPoint ip2 =  parentEnv.findInjectionPoint();
     
      if (ip2 != null)
        return ip2;
     
      throw new InjectionException(L.l("no injection point available in this context {0}",
                                       ip));
    }
View Full Code Here

  public class UnresolvedReferenceFactory extends ReferenceFactory<Object> {
    private InjectionException _exn;
   
    UnresolvedReferenceFactory()
    {
      _exn = new InjectionException("unresolved injection");
    }
View Full Code Here

        field.setAccessible(true);
     
        try {
          field.set(instance, delegateProxy);
        } catch (Exception e) {
          throw new InjectionException(e);
        }
      } else if (ip.getMember() instanceof Method) {
        Method method = (Method) ip.getMember();
        method.setAccessible(true);
     
        try {
          method.invoke(instance, delegateProxy);
        } catch (Exception e) {
          throw new InjectionException(e);
        }
      }
     
      /*
      DecoratorBean<?> decoratorBean = (DecoratorBean<?>) bean;
View Full Code Here

       
        throw new IllegalProductException(loc + e.getMessage(), e);
      } catch (InjectionException e) {
        String loc = getLocation(_field);
     
        throw new InjectionException(loc + e.getMessage(), e);
      }
    }
View Full Code Here

      } catch (AmbiguousResolutionException e) {
        throw new AmbiguousResolutionException(getFieldName(_field) + e.getMessage(), e);
      } catch (IllegalProductException e) {
        throw new IllegalProductException(getFieldName(_field) + e.getMessage(), e);
      } catch (InjectionException e) {
        throw new InjectionException(getFieldName(_field) + e.getMessage(), e);
      } catch (Exception e) {
        throw ConfigException.create(_field, e);
      }
    }
View Full Code Here

   
    BaseType type = manager.createSourceBaseType(producesMethod.getBaseType());
   
    if (type.isGeneric()) {
      // ioc/07f0
      throw new InjectionException(L.l("'{0}' is an invalid @Produces method because it returns a generic type {1}",
                                       producesMethod.getJavaMember(),
                                       type));
    }

    return bean;
View Full Code Here

      ClassLoader loader = Thread.currentThread().getContextClassLoader();

      Class<?> cl = Class.forName(className, false, loader);

      if (! Extension.class.isAssignableFrom(cl))
        throw new InjectionException(L.l("'{0}' is not a valid extension because it does not implement {1}",
                                         cl, Extension.class.getName()));
     
      Extension extension = null;
     
      for (Constructor<?> ctor : cl.getDeclaredConstructors()) {
View Full Code Here

        Throwable cause = e.getCause();

        if (cause instanceof ConfigException)
          throw (ConfigException) cause;
       
        throw new InjectionException(loc + cause.getMessage(), cause);
      } catch (Exception e) {
        String loc = (_extension + "." + _method.getName() + ": ");

        throw new InjectionException(loc + e.getMessage(), e);
      }
    }
View Full Code Here

   
    BaseType type = manager.createSourceBaseType(beanField.getBaseType());

    if (type.isGeneric()) {
      // ioc/07f1
      throw new InjectionException(L.l("'{0}' is an invalid @Produces field because it returns a generic type {1}",
                                       beanField.getJavaMember(),
                                       type));
    }

    return bean;
View Full Code Here

TOP

Related Classes of javax.enterprise.inject.InjectionException

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.