Package org.apache.aries.blueprint.mutable

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


        String keyPasswords = element.getAttribute("keyPasswords");
        if (keyPasswords != null && keyPasswords.length() > 0) {
            bean.addProperty("keyPasswords", createValue(context, keyPasswords));
        }
        // Publish Config
        MutableServiceMetadata service = context.createMetadata(MutableServiceMetadata.class);
    service.setId(name);
        service.setServiceComponent(bean);
        service.addInterface(KeystoreInstance.class.getName());
        return service;
    }
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.addInterface(Function.class.getName());
        commandService.addInterface(CompletableFunction.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.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);

        // 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(getName());
        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.addInterface(Function.class.getName());
        commandService.addInterface(CompletableFunction.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

                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

        String keyPasswords = element.getAttribute("keyPasswords");
        if (keyPasswords != null && keyPasswords.length() > 0) {
            bean.addProperty("keyPasswords", createValue(context, keyPasswords));
        }
        // Publish Config
        MutableServiceMetadata service = context.createMetadata(MutableServiceMetadata.class);
    service.setId(name);
        service.setServiceComponent(bean);
        service.addInterface(KeystoreInstance.class.getName());
        return service;
    }
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);

        String scope;
        String function;
        if (SHELL_NAMESPACE_1_0_0.equals(element.getNamespaceURI())) {
            String location = element.getAttribute(NAME);
            location = location.replace('/', ':');
            if (location.lastIndexOf(':') >= 0) {
                scope = location.substring(0, location.lastIndexOf(':'));
                function = location.substring(location.lastIndexOf(':') + 1);
            } else {
                scope = "";
                function = location;
            }
        } else {
            try {
                Class actionClass = getBundle(context).loadClass(action.getClassName());
                scope = getScope(actionClass);
                function = getName(actionClass);
            } catch (Throwable e) {
                throw new ComponentDefinitionException("Unable to introspect action " + action.getClassName(), e);
            }
        }
        commandService.addServiceProperty(createStringValue(context, "osgi.command.scope"),
                createStringValue(context, scope));
        commandService.addServiceProperty(createStringValue(context, "osgi.command.function"),
                createStringValue(context, function));

        context.getComponentDefinitionRegistry().registerComponentDefinition(commandService);

        String subShellName = null;
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);
        subShellCommandService.setAutoExport(ServiceMetadata.AUTO_EXPORT_INTERFACES);
        subShellCommandService.setServiceComponent(subShellCommand);
        subShellCommandService.addServiceProperty(createStringValue(context, "osgi.command.scope"), createStringValue(context, "*"));
        subShellCommandService.addServiceProperty(createStringValue(context, "osgi.command.function"), createStringValue(context, scope));
        context.getComponentDefinitionRegistry().registerComponentDefinition(subShellCommandService);
    }
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

        String keyPasswords = element.getAttribute("keyPasswords");
        if (keyPasswords != null && keyPasswords.length() > 0) {
            bean.addProperty("keyPasswords", createValue(context, keyPasswords));
        }
        // Publish Config
        MutableServiceMetadata service = context.createMetadata(MutableServiceMetadata.class);
        service.setId(name);
        service.setServiceComponent(bean);
        service.addInterface(KeystoreInstance.class.getName());
        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.