Package org.erlide.engine

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


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

TOP

Related Classes of org.erlide.engine.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.