Package org.apache.aries.blueprint.mutable

Examples of org.apache.aries.blueprint.mutable.MutableServiceMetadata


        if(!!! entries.isEmpty()) {
         
            try {
                if(component instanceof MutableServiceMetadata) {
                    processingStack.add("Service Properties->");
                    MutableServiceMetadata msm = (MutableServiceMetadata) component;
               
                    for (MapEntry entry : entries) {
                        msm.removeServiceProperty(entry);
                    }
                    for (MapEntry entry : processMapEntries(entries)) {
                        msm.addServiceProperty(entry);
                    }
                } else {
                    printWarning(component, "Service Properties");
                    processingStack.add("Service Properties->");
                    processMapEntries(entries);
View Full Code Here


        if(!!! entries.isEmpty()) {
         
            try {
                if(component instanceof MutableServiceMetadata) {
                    processingStack.add("Service Properties->");
                    MutableServiceMetadata msm = (MutableServiceMetadata) component;
               
                    for (MapEntry entry : entries) {
                        msm.removeServiceProperty(entry);
                    }
                    for (MapEntry entry : processMapEntries(entries)) {
                        msm.addServiceProperty(entry);
                    }
                } else {
                    printWarning(component, "Service Properties");
                    processingStack.add("Service Properties->");
                    processMapEntries(entries);
View Full Code Here

                    throw new ComponentDefinitionException("Bad xml syntax: unknown element '" + childElement.getNodeName() + "'");
                }
            }
        }

        MutableServiceMetadata commandService = context.createMetadata(MutableServiceMetadata.class);
        commandService.setActivation(MutableServiceMetadata.ACTIVATION_LAZY);
        commandService.setId(getName());
        commandService.setAutoExport(ServiceMetadata.AUTO_EXPORT_ALL_CLASSES);
        commandService.setServiceComponent(command);

        String scope = null;
        if (SHELL_NAMESPACE_1_0_0.equals(element.getNamespaceURI())) {
            String location = element.getAttribute(NAME);
            location = location.replace('/', ':');
            String function;
            if (location.lastIndexOf(':') >= 0) {
                scope = location.substring(0, location.lastIndexOf(':'));
                function = location.substring(location.lastIndexOf(':') + 1);
            } else {
                scope = "";
                function = location;
            }
            commandService.addServiceProperty(createStringValue(context, "osgi.command.scope"),
                                              createStringValue(context, scope));
            commandService.addServiceProperty(createStringValue(context, "osgi.command.function"),
                                              createStringValue(context, function));
        } else {
            commandService.addServiceProperty(createStringValue(context, "osgi.command.scope"),
                                              getInvocationValue(context, "getScope", action.getClassName()));
            commandService.addServiceProperty(createStringValue(context, "osgi.command.function"),
                                              getInvocationValue(context, "getName", action.getClassName()));
        }

        context.getComponentDefinitionRegistry().registerComponentDefinition(commandService);
View Full Code Here

        subShellCommand.addProperty(BLUEPRINT_CONTAINER, createRef(context, BLUEPRINT_CONTAINER));
        subShellCommand.addProperty(BLUEPRINT_CONVERTER, createRef(context, BLUEPRINT_CONVERTER));
        subShellCommand.addProperty(ACTION_ID, createIdRef(context, subShellAction.getId()));
        context.getComponentDefinitionRegistry().registerComponentDefinition(subShellCommand);
        // generate the sub-shell OSGi service
        MutableServiceMetadata subShellCommandService = context.createMetadata(MutableServiceMetadata.class);
        subShellCommandService.setActivation(MutableServiceMetadata.ACTIVATION_LAZY);
        subShellCommandService.setId(subShellName == null ? getName() : subShellName);
        subShellCommandService.setAutoExport(ServiceMetadata.AUTO_EXPORT_ALL_CLASSES);
        subShellCommandService.setServiceComponent(subShellCommand);
        subShellCommandService.addServiceProperty(createStringValue(context, "osgi.command.scope"), createStringValue(context, "*"));
        if (scope != null && !scope.isEmpty()) {
            // it's shell 1.0.0 schema, scope is contained in the descriptor itself
            subShellCommandService.addServiceProperty(createStringValue(context, "osgi.command.function"), createStringValue(context, scope));
        } else {
            // it's shell 1.1.0 schema, we inject the scope from the command
            subShellCommandService.addServiceProperty(createStringValue(context, "osgi.command.function"), getInvocationValue(context, "getScope", action.getClassName()));
        }
        context.getComponentDefinitionRegistry().registerComponentDefinition(subShellCommandService);
    }
View Full Code Here

                    throw new ComponentDefinitionException("Bad xml syntax: unknown element '" + childElement.getNodeName() + "'");
                }
            }
        }

        MutableServiceMetadata commandService = context.createMetadata(MutableServiceMetadata.class);
        commandService.setActivation(MutableServiceMetadata.ACTIVATION_LAZY);
        commandService.setId(getName());
        commandService.setAutoExport(ServiceMetadata.AUTO_EXPORT_ALL_CLASSES);
        commandService.setServiceComponent(command);

        String scope = null;
        if (SHELL_NAMESPACE_1_0_0.equals(element.getNamespaceURI())) {
            String location = element.getAttribute(NAME);
            location = location.replace('/', ':');
            String function;
            if (location.lastIndexOf(':') >= 0) {
                scope = location.substring(0, location.lastIndexOf(':'));
                function = location.substring(location.lastIndexOf(':') + 1);
            } else {
                scope = "";
                function = location;
            }
            commandService.addServiceProperty(createStringValue(context, "osgi.command.scope"),
                                              createStringValue(context, scope));
            commandService.addServiceProperty(createStringValue(context, "osgi.command.function"),
                                              createStringValue(context, function));
        } else {
            commandService.addServiceProperty(createStringValue(context, "osgi.command.scope"),
                                              getInvocationValue(context, "getScope", action.getClassName()));
            commandService.addServiceProperty(createStringValue(context, "osgi.command.function"),
                                              getInvocationValue(context, "getName", action.getClassName()));
        }
       
        context.getComponentDefinitionRegistry().registerComponentDefinition(commandService);

        String subShellName = ".subshell." + scope;
        if (!context.getComponentDefinitionRegistry().containsComponentDefinition(subShellName)) {
            // create the sub-shell action
            MutableBeanMetadata subShellAction = context.createMetadata(MutableBeanMetadata.class);
            subShellAction.setRuntimeClass(SubShellAction.class);
            subShellAction.setActivation(MutableBeanMetadata.ACTIVATION_LAZY);
            subShellAction.setScope(MutableBeanMetadata.SCOPE_PROTOTYPE);
            subShellAction.setId(getName());
            if (scope != null && !scope.isEmpty()) {
                // it's shell 1.0.0 schema, scope is contained in the descriptor itself
                subShellAction.addProperty("subShell", createStringValue(context, scope));
            } else {
                // it's shell 1.1.0 schema, we inject the scope from the command
                subShellAction.addProperty("subShell", getInvocationValue(context, "getScope", action.getClassName()));
            }
            context.getComponentDefinitionRegistry().registerComponentDefinition(subShellAction);
            // generate the sub-shell command
            MutableBeanMetadata subShellCommand = context.createMetadata(MutableBeanMetadata.class);
            subShellCommand.setId(getName());
            subShellCommand.setRuntimeClass(BlueprintCommand.class);
            subShellCommand.addProperty(BLUEPRINT_CONTAINER, createRef(context, BLUEPRINT_CONTAINER));
            subShellCommand.addProperty(BLUEPRINT_CONVERTER, createRef(context, BLUEPRINT_CONVERTER));
            subShellCommand.addProperty(ACTION_ID, createIdRef(context, subShellAction.getId()));
            context.getComponentDefinitionRegistry().registerComponentDefinition(subShellCommand);
            // generate the sub-shell OSGi service
            MutableServiceMetadata subShellCommandService = context.createMetadata(MutableServiceMetadata.class);
            subShellCommandService.setActivation(MutableServiceMetadata.ACTIVATION_LAZY);
            subShellCommandService.setId(subShellName);
            subShellCommandService.setAutoExport(ServiceMetadata.AUTO_EXPORT_ALL_CLASSES);
            subShellCommandService.setServiceComponent(subShellCommand);
            subShellCommandService.addServiceProperty(createStringValue(context, "osgi.command.scope"), createStringValue(context, "*"));
            if (scope != null && !scope.isEmpty()) {
                // it's shell 1.0.0 schema, scope is contained in the descriptor itself
                subShellCommandService.addServiceProperty(createStringValue(context, "osgi.command.function"), createStringValue(context, scope));
            } else {
                // it's shell 1.1.0 schema, we inject the scope from the command
                subShellCommandService.addServiceProperty(createStringValue(context, "osgi.command.function"), getInvocationValue(context, "getScope", action.getClassName()));
            }
            context.getComponentDefinitionRegistry().registerComponentDefinition(subShellCommandService);
        }
    }
View Full Code Here

        if(!!! entries.isEmpty()) {
         
            try {
                if(component instanceof MutableServiceMetadata) {
                    processingStack.add("Service Properties->");
                    MutableServiceMetadata msm = (MutableServiceMetadata) component;
               
                    for (MapEntry entry : entries) {
                        msm.removeServiceProperty(entry);
                    }
                    for (MapEntry entry : processMapEntries(entries)) {
                        msm.addServiceProperty(entry);
                    }
                } else {
                    printWarning(component, "Service Properties");
                    processingStack.add("Service Properties->");
                    processMapEntries(entries);
View Full Code Here

                    throw new ComponentDefinitionException("Bad xml syntax: unknown element '" + childElement.getNodeName() + "'");
                }
            }
        }

        MutableServiceMetadata commandService = context.createMetadata(MutableServiceMetadata.class);
        commandService.setActivation(MutableServiceMetadata.ACTIVATION_LAZY);
        commandService.setId(getName());
        //commandService.setAutoExport(ServiceMetadata.AUTO_EXPORT_ALL_CLASSES);
        commandService.addInterface(CompletableFunction.class.getName());
        commandService.addInterface(Function.class.getName());
        commandService.setServiceComponent(command);
        commandService.addServiceProperty(createStringValue(context, "osgi.command.scope"),
                                          createStringValue(context, scope));
        commandService.addServiceProperty(createStringValue(context, "osgi.command.function"),
                                          createStringValue(context, function));
        context.getComponentDefinitionRegistry().registerComponentDefinition(commandService);
    }
View Full Code Here

                    throw new ComponentDefinitionException("Bad xml syntax: unknown element '" + childElement.getNodeName() + "'");
                }
            }
        }

        MutableServiceMetadata commandService = context.createMetadata(MutableServiceMetadata.class);
        commandService.setActivation(MutableServiceMetadata.ACTIVATION_LAZY);
        commandService.setId(getName());
        //commandService.setAutoExport(ServiceMetadata.AUTO_EXPORT_ALL_CLASSES);
        commandService.addInterface(CompletableFunction.class.getName());
        commandService.addInterface(Function.class.getName());
        commandService.setServiceComponent(command);
        commandService.addServiceProperty(createStringValue(context, "osgi.command.scope"),
                                          createStringValue(context, scope));
        commandService.addServiceProperty(createStringValue(context, "osgi.command.function"),
                                          createStringValue(context, function));
        context.getComponentDefinitionRegistry().registerComponentDefinition(commandService);
    }
View Full Code Here

                    throw new ComponentDefinitionException("Bad xml syntax: unknown element '" + childElement.getNodeName() + "'");
                }
            }
        }

        MutableServiceMetadata commandService = context.createMetadata(MutableServiceMetadata.class);
        commandService.setActivation(MutableServiceMetadata.ACTIVATION_LAZY);
        commandService.setId(getName());
        commandService.setAutoExport(ServiceMetadata.AUTO_EXPORT_INTERFACES);
        commandService.setServiceComponent(command);
        commandService.addServiceProperty(createStringValue(context, "osgi.command.scope"),
                                          createStringValue(context, scope));
        commandService.addServiceProperty(createStringValue(context, "osgi.command.function"),
                                          createStringValue(context, function));
        context.getComponentDefinitionRegistry().registerComponentDefinition(commandService);
    }
View Full Code Here

                children.addValue(md);
            }
            bean.addProperty("modules", children);
        }
        // Publish Config
        MutableServiceMetadata service = context.createMetadata(MutableServiceMetadata.class);
    service.setId(name);
        service.setServiceComponent(bean);
        service.addInterface(JaasRealm.class.getName());
        service.addServiceProperty(createValue(context, ProxyLoginModule.PROPERTY_MODULE), createValue(context, name));
        return service;
    }
View Full Code Here

TOP

Related Classes of org.apache.aries.blueprint.mutable.MutableServiceMetadata

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.