Examples of InjectionException


Examples of javax.enterprise.inject.InjectionException

      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

Examples of javax.enterprise.inject.InjectionException

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

Examples of javax.enterprise.inject.InjectionException

                    field.set(instance, Integer.parseInt(fieldValueFromXml));
                } else if (field.getType().isAssignableFrom(String.class)) {
                    field.set(instance, fieldValueFromXml);
                } else {
                    // TODO: left up for the reader
                    throw new InjectionException("Cannot convert to type " + field.getType());
                }
            } catch (IllegalAccessException e) {
                throw new InjectionException("Cannot access field " + field);
            }
        }
    }
View Full Code Here

Examples of org.apache.geronimo.jaxws.annotations.InjectionException

    private Object lookupJNDI(String name, Class<?> type)
            throws InjectionException {
        try {
            return jndiResolver.resolve(name, type);
        } catch (NamingException e) {
            throw new InjectionException("JNDI injection failed for resource '"
                    + name + "'", e);
        }
    }
View Full Code Here

Examples of org.erlide.engine.InjectionException

    @Override
    public <T extends ErlangService> T getService(final Class<T> type) {
        try {
            final Class<? extends ErlangService> clazz = implementations.get(type);
            if (clazz == null) {
                throw new InjectionException(
                        "ErlangService implementation not found for " + type.getName());
            }

            final Constructor<?> constructor = clazz.getConstructors()[0];
            final Class<?>[] parameterTypes = constructor.getParameterTypes();
            final Object[] initargs = new Object[parameterTypes.length];
            for (int i = 0; i < parameterTypes.length; i++) {
                final Class<?> paramType = parameterTypes[i];
                initargs[i] = injectParameter(paramType);
            }
            return (T) constructor.newInstance(initargs);
        } catch (final Exception e) {
            throw new InjectionException("Could not instantiate service "
                    + type.getName(), e);
        }
    }
View Full Code Here

Examples of org.erlide.engine.InjectionException

            return getModel();
        }
        if (String.class == paramType) {
            return getStateDir();
        }
        throw new InjectionException(
                "Constructor parameters are not injectable (ErlangService): "
                        + paramType.getName());
    }
View Full Code Here

Examples of org.jboss.injection.manager.spi.InjectionException

         this.inject(injectionContext.getInjectedType(), injectionContext.getInjectionTarget());
         injectionContext.proceed();
      }
      catch (NamingException e)
      {
         throw new InjectionException(e);
      }
   }
View Full Code Here

Examples of org.jboss.msc.inject.InjectionException

            .addDependency(ContextNames.contextServiceNameOfModule("managedbean-example", "managedbean-example"), NamingStore.class, new Injector<NamingStore>() {
                public void inject(final NamingStore value) throws InjectionException {
                    try {
                        injector.inject((Context) value.lookup(new CompositeName()));
                    } catch (NamingException e) {
                        throw new InjectionException(e);
                    }
                }

                public void uninject() {
                    injector.uninject();
View Full Code Here

Examples of org.jboss.msc.inject.InjectionException

            .addDependency(ContextNames.contextServiceNameOfModule("managedbean-example", "managedbean-example"), NamingStore.class, new Injector<NamingStore>() {
                public void inject(final NamingStore value) throws InjectionException {
                    try {
                        injector.inject((Context) value.lookup(new CompositeName()));
                    } catch (NamingException e) {
                        throw new InjectionException(e);
                    }
                }

                public void uninject() {
                    injector.uninject();
View Full Code Here

Examples of org.jboss.weld.exceptions.InjectionException

    @Override
    public void validate(InjectionPoint ij) {
        try {
            getServices().get(Validator.class).validateInjectionPoint(ij, this);
        } catch (DeploymentException e) {
            throw new InjectionException(e.getLocalizedMessage(), e.getCause());
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.