Package org.apache.hivemind.definition

Examples of org.apache.hivemind.definition.ImplementationDefinition


            servicePoint.setAttribute("visibility", "private");
       
        if (spd instanceof XmlServicePointDefinitionImpl)
            processXmlServicePoint(servicePoint, (XmlServicePointDefinitionImpl) spd);
       
        ImplementationDefinition ib = spd.getDefaultImplementation();

        if (ib != null)
        {
            Element instanceBuilder = getInstanceBuilderElement(ib, ib.getServiceConstructor());

            servicePoint.appendChild(instanceBuilder);
        }

        Collection interceptors = spd.getInterceptors();
View Full Code Here


        if (builder == null && interceptors == null)
            return;

        if (builder != null) {
            ImplementationDefinition implementation = new ImplementationDefinitionImpl(
                    module, builder.getLocation(), builder.createConstructor(module.getId()),
                    builder.getServiceModel(), false);
            point.addImplementation(implementation);
        }
        if (interceptors == null)
View Full Code Here

        ModuleDefinitionImpl module = createModuleDefinition("hivemind.tests.serviceByInterface");
        definition.addModule(module);
       
        ServicePointDefinitionImpl sp1 = createServicePointDefinition(module, "BeanInterface", BeanInterface.class);
        ImplementationDefinition impl = new ImplementationDefinitionImpl(module, newLocation(),
                constructor, ServiceModel.SINGLETON, true);
        sp1.addImplementation(impl);
        module.addServicePoint(sp1);
        Registry reg = buildFrameworkRegistry(module);
        return reg;
View Full Code Here

        new InterceptorStackImpl(null, mockServicePoint, null).toString();

        ModuleDefinition md = new ModuleDefinitionImpl("module", null, null, null);
        ServicePointDefinitionImpl spd = new ServicePointDefinitionImpl(md, "service", null,
                Visibility.PUBLIC, Runnable.class.getName());
        ImplementationDefinition sid = new ImplementationDefinitionImpl(md,
                null, null, ServiceModel.PRIMITIVE, true);
        spd.addImplementation(sid);
        new ServicePointImpl(module, spd).toString();
    }
View Full Code Here

                    + _servicePoint.getExtensionPointId());

        Class serviceInterface = _servicePoint.getServiceInterface();
        Class declaredInterface = _servicePoint.getDeclaredInterface();

        ImplementationDefinition implementationDefinition = _servicePoint.getImplementationDefinition();
        ImplementationConstructor constructor = implementationDefinition.getServiceConstructor();
        // Get a reference to the module that provided the implementation
        String definingModuleId = implementationDefinition.getModuleId();
       
        Module definingModule = getRegistry().getModule(definingModuleId);
        ImplementationConstructionContext context = new ImplementationConstructionContextImpl(definingModule,
                _servicePoint);
        Object result = constructor.constructCoreServiceImplementation(context);
View Full Code Here

        module.addServicePoint(spd);

        ImplementationConstructor constructor = new MethodCallImplementationConstructor(location,
                method, instanceProvider);

        ImplementationDefinition sid = new ImplementationDefinitionImpl(module, location,
                constructor, service.serviceModel(), true);

        spd.addImplementation(sid);

    }
View Full Code Here

                RunnableImpl result = new RunnableImpl();
                result.setType(serviceModel);
                return result;
            }};
       
        ImplementationDefinition impl = new ImplementationDefinitionImpl(module, newLocation(),
                constructor, serviceModel, true);
        sp1.addImplementation(impl);
        module.addServicePoint(sp1);
        return buildFrameworkRegistry(module);
    }
View Full Code Here

            ServicePointDefinition servicePoint,
            ImplementationConstructor constructor, String serviceModel
            )
    {
        // These implementations override the inline implementations, so default is true here
        ImplementationDefinition result = new ImplementationDefinitionImpl(_module, _module
                .getLocation(), constructor, serviceModel, true);
        servicePoint.addImplementation(result);
        return result;
    }
View Full Code Here

    /**
     * Convenience method for creating a {@link ImplementationDefinition}.
     */
    protected ImplementationDefinition createServiceImplementationDefinition(ModuleDefinition module, Class serviceImplementationClass)
    {
        ImplementationDefinition result = new ImplementationDefinitionImpl(module, newLocation(),
                new CreateClassServiceConstructor(newLocation(), serviceImplementationClass.getName()),
                "singleton", true);

        return result;
    }
View Full Code Here

      super.setUp();
     
        ModuleDefinitionImpl module = createModuleDefinition("hivemind.tests.serviceByInterface");

        ServicePointDefinitionImpl sp1 = createServicePointDefinition(module, "uniqueService", IUniqueService.class);
        ImplementationDefinition impl1 = createServiceImplementationDefinition(module, UniqueServiceImpl.class);
        sp1.addImplementation(impl1);

        module.addServicePoint(sp1);

        ServicePointDefinitionImpl sp2 = createServicePointDefinition(module, "multipleServiceOne", IMultipleService.class);
        ImplementationDefinition impl2 = createServiceImplementationDefinition(module, MultipleServiceImpl.class);
        sp2.addImplementation(impl2);

        module.addServicePoint(sp2);

        ServicePointDefinitionImpl sp3 = createServicePointDefinition(module, "multipleServiceTwo", IMultipleService.class);
View Full Code Here

TOP

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

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.