Package org.apache.hivemind.definition

Examples of org.apache.hivemind.definition.ServicePointDefinition


    public void testLocation()
    {
        RegistryDefinition registry = constructRegistryDefinition(SimpleAnnotatedModule.class);
        ModuleDefinition module = registry.getModule("org.apache.hivemind.annotations.SimpleAnnotatedModule");
        assertEquals("Class org.apache.hivemind.annotations.SimpleAnnotatedModule", module.getLocation().toString());
        ServicePointDefinition service = registry.getServicePoint("org.apache.hivemind.annotations.SimpleAnnotatedModule.Test");
        assertEquals("Class org.apache.hivemind.annotations.SimpleAnnotatedModule, method getRunnable", service.getLocation().toString());
    }
View Full Code Here


        if (servicePoints != null)
        {
            for (Iterator i = servicePoints.iterator(); i.hasNext();)
            {
                ServicePointDefinition spd = (ServicePointDefinition) i.next();

                Element servicePoint = getServicePointElement(spd);

                module.appendChild(servicePoint);
View Full Code Here

    private Registry createRegistryWithSimpleService(final String serviceModel, final boolean manual)
    {
        ModuleDefinitionImpl module = createModuleDefinition("hivemind.lib.test");
        ModuleDefinitionHelper helper = new ModuleDefinitionHelper(module);

        ServicePointDefinition sp1 = helper.addServicePoint("Simple", Simple.class.getName());

        // Define inline implementation constructor, that passes the ShutdownCoordinator service if manual is true
        ImplementationConstructor constructor = new AbstractServiceImplementationConstructor(module.getLocation())
        {
            public Object constructCoreServiceImplementation(ImplementationConstructionContext context)
View Full Code Here

    private Registry createRegistryWithPojo(final String serviceModel)
    {
        ModuleDefinitionImpl module = createModuleDefinition("hivemind.lib.test");
        ModuleDefinitionHelper helper = new ModuleDefinitionHelper(module);

        ServicePointDefinition sp1 = helper.addServicePoint("RegistryShutdownBean", RegistryShutdownBean.class.getName());
        helper.addSimpleServiceImplementation(sp1, RegistryShutdownBean.class.getName(), serviceModel);

        return buildFrameworkRegistry(module);
    }
View Full Code Here

            ServicePoint factoryPoint = contributingModule.getServicePoint(_factoryServiceId);

            _factory = (ServiceInterceptorFactory) factoryPoint
                    .getService(ServiceInterceptorFactory.class);

            ServicePointDefinition spd = factoryPoint.getServicePointDefinition();
            if (!(spd instanceof XmlServicePointDefinitionImpl)) {
                // TODO annotations: Externalize message
                throw new ApplicationRuntimeException("ServicePoint used as InterceptorFactory must be of type XmlServicePointDefinitionImpl");
            }
            XmlServicePointDefinitionImpl xmlServicePoint = (XmlServicePointDefinitionImpl) spd;
View Full Code Here

    /**
     * @see TranslatorManager
     */
    private void addTranslatorManager(ModuleDefinition md, final ErrorHandler errorHandler)
    {
        ServicePointDefinition spd = helper.addServicePoint("TranslationManager", TranslatorManager.class.getName());

        // Define inline implementation constructor, that wires the Translators configuration
        ImplementationConstructor constructor = new AbstractServiceImplementationConstructor(md.getLocation())
        {
            public Object constructCoreServiceImplementation(ImplementationConstructionContext context)
View Full Code Here

     * Adds a service that implements the symbol source interface and a
     * corresponding configuration point that holds the symbol values.
     */
    private void addSymbolSource(ModuleDefinition md, final String servicePointId, final String configurationId)
    {
        ServicePointDefinition spd = helper.addServicePoint(servicePointId, SymbolSource.class.getName());

        // Define inline implementation constructor, that wires the corresponding configuration
        ImplementationConstructor constructor = new AbstractServiceImplementationConstructor(md.getLocation())
        {
            public Object constructCoreServiceImplementation(ImplementationConstructionContext context)
View Full Code Here

    /**
     * @see SymbolExpander
     */
    private void addSymbolExpander(ModuleDefinition md, final ErrorHandler errorHandler)
    {
        ServicePointDefinition spd = helper.addServicePoint("SymbolExpander", SymbolExpander.class.getName());

        // Define inline implementation constructor, that wires ErrorHandler and SymbolSources
        ImplementationConstructor constructor = new AbstractServiceImplementationConstructor(md.getLocation())
        {
            public Object constructCoreServiceImplementation(ImplementationConstructionContext context)
View Full Code Here

    public ServicePointDefinition getServicePoint(String qualifiedServicePointId)
    {
        String moduleId = IdUtils.extractModule(qualifiedServicePointId);
        String servicePointId = IdUtils.stripModule(qualifiedServicePointId);

        ServicePointDefinition servicePoint = null;
        ModuleDefinition module = getModule(moduleId);
        if (module != null)
        {
            servicePoint = module.getServicePoint(servicePointId);
        }
View Full Code Here

            String servicePointId = unresolved.getExtensionPointId();
            if (LOG.isDebugEnabled()) {
                LOG.debug("Trying to resolve service point " + servicePointId + " referenced by" +
                        " implementation" + logLocation(unresolved.getExtension().getLocation()));
            }
            ServicePointDefinition servicePoint = _definition.getServicePoint(servicePointId);
            if (servicePoint == null)
            {
                _errorHandler.error(
                        LOG,
                        DefinitionMessages.unknownServicePoint(
                                IdUtils.extractModule(servicePointId),
                                IdUtils.stripModule(servicePointId)),
                        unresolved.getExtension().getLocation(),
                        null);
            } else {
                servicePoint.addImplementation((ImplementationDefinition) unresolved.getExtension());
            }
            iter.remove();
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.hivemind.definition.ServicePointDefinition

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.