Package org.apache.hivemind.internal

Examples of org.apache.hivemind.internal.AbstractServiceImplementationConstructor


        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)
            {
                Object result;
                if (manual) {
View Full Code Here


    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)
            {
                List translators = (List) context.getConfiguration("Translators");
                TranslatorManager result = new TranslatorManagerImpl(translators, errorHandler);
View Full Code Here

    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)
            {
                DefaultsSymbolSource result = new DefaultsSymbolSource();
                result.setDefaults(((Map) context.getConfiguration(configurationId)).values());
View Full Code Here

    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)
            {
                List symbolSources = (List) context.getConfiguration("SymbolSources");
View Full Code Here

    {
        ModuleDefinitionImpl module = createModuleDefinition("hivemind.test.services");
        ModuleDefinitionHelper helper = new ModuleDefinitionHelper(module);
        ServicePointDefinition sp = helper.addServicePoint("Recursive", SimpleService.class.getName());

        ImplementationConstructor constructor = new AbstractServiceImplementationConstructor(module.getLocation())
        {
            public Object constructCoreServiceImplementation(ImplementationConstructionContext context)
            {
                Object result = new SimpleServiceImpl();
                // Here is the recursion
View Full Code Here

    private void addThreadLocale(ModuleDefinition md)
    {
        ServicePointDefinition spd = helper.addServicePoint("ThreadLocale", ThreadLocale.class.getName());

        // Define inline implementation constructor
        ImplementationConstructor constructor = new AbstractServiceImplementationConstructor(md.getLocation())
        {

            public Object constructCoreServiceImplementation(ImplementationConstructionContext context)
            {
                // Get the Locale from the registry
View Full Code Here

    private void addEagerLoad(ModuleDefinition md)
    {
        ServicePointDefinition spd = helper.addServicePoint("EagerLoad", Runnable.class.getName());

        // Define inline implementation constructor, that wires the EagerLoad configuration
        ImplementationConstructor constructor = new AbstractServiceImplementationConstructor(md.getLocation())
        {
            public Object constructCoreServiceImplementation(ImplementationConstructionContext context)
            {
                EagerLoader result = new EagerLoader();
                result.setServicePoints((List) context.getConfiguration("EagerLoad"));
View Full Code Here

    private void addStartup(ModuleDefinition md)
    {
        ServicePointDefinition spd = helper.addServicePoint("Startup", Runnable.class.getName());

        // Define inline implementation constructor, that wires the Startup configuration
        ImplementationConstructor constructor = new AbstractServiceImplementationConstructor(md.getLocation())
        {
            public Object constructCoreServiceImplementation(ImplementationConstructionContext context)
            {
                StartupImpl result = new StartupImpl();
                result.setRunnables((List) context.getConfiguration("Startup"));
View Full Code Here

    private void addInterfaceSynthesizer(ModuleDefinition md)
    {
        ServicePointDefinition spd = helper.addServicePoint("InterfaceSynthesizer", InterfaceSynthesizer.class.getName());

        // Define inline implementation constructor
        ImplementationConstructor constructor = new AbstractServiceImplementationConstructor(md.getLocation())
        {
            public Object constructCoreServiceImplementation(ImplementationConstructionContext context)
            {
                InterfaceSynthesizerImpl result = new InterfaceSynthesizerImpl();
                // Manual wiring of the class factory
View Full Code Here

    private void addAutowiring(ModuleDefinition md)
    {
        ServicePointDefinition spd = helper.addServicePoint("Autowiring", Autowiring.class.getName());

        // Define inline implementation constructor, that wires the AutowiringStrategies configuration
        ImplementationConstructor constructor = new AbstractServiceImplementationConstructor(md.getLocation())
        {
            public Object constructCoreServiceImplementation(ImplementationConstructionContext context)
            {
                List strategies = (List) context.getConfiguration("AutowiringStrategies");
                Autowiring result = new AutowiringImpl(context.getRegistry(), strategies, context.getDefiningModule().getErrorHandler());
View Full Code Here

TOP

Related Classes of org.apache.hivemind.internal.AbstractServiceImplementationConstructor

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.