Package org.apache.hivemind

Examples of org.apache.hivemind.ApplicationRuntimeException


            count++;
        }

        if (count == 0)
            throw new ApplicationRuntimeException(ImplMessages
                    .noServicePointForInterface(serviceInterface));

        if (count > 1)
            throw new ApplicationRuntimeException(ImplMessages.multipleServicePointsForInterface(
                    serviceInterface,
                    servicePoints));

        return point.getService(serviceInterface);
    }
View Full Code Here


        checkShutdown();

        ConfigurationPoint result = (ConfigurationPoint) _configurationPoints.get(configurationId);

        if (result == null)
            throw new ApplicationRuntimeException(ImplMessages.noSuchConfiguration(configurationId));

        if (!result.visibleToModule(module))
            throw new ApplicationRuntimeException(ImplMessages.configurationNotVisible(
                    configurationId,
                    module));

        return result;
    }
View Full Code Here

            count++;
        }

        if (count == 0)
            throw new ApplicationRuntimeException(ImplMessages
                    .noConfigurationPointForType(configurationType));

        if (count > 1)
            throw new ApplicationRuntimeException(ImplMessages.multipleConfigurationPointsForType(
                    configurationType,
                    configurationPoints));

        return point.getConfiguration();
    }
View Full Code Here

     */

    private void checkShutdown()
    {
        if (_shutdown)
            throw new ApplicationRuntimeException(HiveMindMessages.registryShutdown());
    }
View Full Code Here

            readServiceModelFactories();

        ServiceModelFactory result = (ServiceModelFactory) _serviceModelFactories.get(name);

        if (result == null)
            throw new ApplicationRuntimeException(ImplMessages.unknownServiceModel(name));

        return result;
    }
View Full Code Here

            getCtClass().addField(field);
        }
        catch (CannotCompileException ex)
        {
            throw new ApplicationRuntimeException(ServiceMessages.unableToAddField(
                    name,
                    getCtClass(),
                    ex), ex);
        }
    }
View Full Code Here

    }
   
    public MethodFab addMethod(int modifiers, MethodSignature ms, String body)
    {
        if (_methods.get(ms) != null)
            throw new ApplicationRuntimeException(ServiceMessages.duplicateMethodInClass(ms, this));

        CtClass ctReturnType = convertClass(ms.getReturnType());

        CtClass[] ctParameters = convertClasses(ms.getParameterTypes());
        CtClass[] ctExceptions = convertClasses(ms.getExceptionTypes());

        CtMethod method = new CtMethod(ctReturnType, ms.getName(), ctParameters, getCtClass());

        try
        {
            method.setModifiers(modifiers);
            method.setBody(body);
            method.setExceptionTypes(ctExceptions);

            getCtClass().addMethod(method);
        }
        catch (Exception ex)
        {
            throw new ApplicationRuntimeException(ServiceMessages.unableToAddMethod(
                    ms,
                    getCtClass(),
                    ex), ex);
        }
View Full Code Here

            _constructors.add(new AddedConstructor(parameterTypes, exceptions, body));
        }
        catch (Exception ex)
        {
            throw new ApplicationRuntimeException(ServiceMessages.unableToAddConstructor(
                    getCtClass(),
                    ex), ex);
        }
    }
View Full Code Here

     */
    public void addModule(ModuleDefinition module) throws ApplicationRuntimeException
    {
        if (_modules.containsKey(module.getId()))
        {
            throw new ApplicationRuntimeException(DefinitionMessages.duplicateModuleId(module.getId()));
        }
        else
        {
            if (LOG.isDebugEnabled())
                LOG.debug("Adding module " + module.getId() + " to registry definition");
View Full Code Here

    {
        try
        {
           AutowiringStrategy strategy = (AutowiringStrategy) _strategies.get(strategyName);
           if (strategy == null) {
               throw new ApplicationRuntimeException(ServiceMessages.unknownStrategy(strategyName));
           }
           return strategy.autowireProperty(_registry, target, propertyName);
        }
        catch (Exception ex)
        {
View Full Code Here

TOP

Related Classes of org.apache.hivemind.ApplicationRuntimeException

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.