Package javax.jbi.component

Examples of javax.jbi.component.Component


            unzip(context, new JarFile(new File(targetDir, zip)), installUri);
            // Add component config as a dependency
            Artifact sl = new Artifact("servicemix-components", comp, "0.0", "car");
            environment.addDependency(sl, ImportType.ALL);
             // Deploy the SU on the component
             Component jbiServiceUnit = null;
             try {
                 jbiServiceUnit = getAssociatedJbiServiceUnit(comp, sl);
             } catch (GBeanNotFoundException e) {
                 throw new DeploymentException("Can not find the associated service unit for this service assembly. "
                         + "Check if it's deployed and started.", e);
             }
             ServiceUnitManager serviceUnitManager = jbiServiceUnit.getServiceUnitManager();
             File installDir = new File(context.getBaseDir(), installUri.toString());
             String deploy = serviceUnitManager.deploy(name, installDir.getAbsolutePath())
             log.debug(deploy);
        }
        // Create the JBI deployment managed object
View Full Code Here


        Properties props = new Properties();
        props.put("jbiType", "JBIComponent");
        props.put("name", compName);
        org.apache.servicemix.geronimo.Component serviceUnit =
                (org.apache.servicemix.geronimo.Component) kernel.getGBean(new AbstractName(artifactName, props));
        Component jbiServiceUnit = serviceUnit.getComponent();
        return jbiServiceUnit;
    }
View Full Code Here

            }
        }
    }

    protected MessageExchangeListener getExchangeListener() {
        Component comp = this.component.getComponent();
        if (comp instanceof MessageExchangeListener) {
            return (MessageExchangeListener) comp;
        }
        ComponentLifeCycle lifecycle = this.component.getLifeCycle();
        if (lifecycle instanceof MessageExchangeListener) {
View Full Code Here

     * @param context
     * @param exchange
     * @return the EndpointFilter
     */
    protected EndpointFilter createEndpointFilter(ComponentContextImpl context, MessageExchangeImpl exchange) {
        Component component = context.getComponent();
        if (exchange.getRole() == Role.PROVIDER) {
            return new ConsumerComponentEndpointFilter(component);
        } else {
            return new ProducerComponentEndpointFilter(component);
        }
View Full Code Here

            Map.Entry e = (Map.Entry) it.next();
            String key = (String) e.getKey();
            List l = (List) e.getValue();
            for (Iterator itEp = l.iterator(); itEp.hasNext();) {
                Object endpoint = itEp.next();
                Component c = null;
                if (key.length() > 0) {
                    Component comp = (Component) components.get(key);
                    if (comp == null) {
                        throw new JBIException("Could not find component '" + key + "' specified for endpoint");
                    }
                    c = comp;
                } else {
                    for (Iterator itCmp = components.values().iterator(); itCmp.hasNext();) {
                        Component comp = (Component) itCmp.next();
                        Class[] endpointClasses = (Class[]) getEndpointClassesMethod.invoke(comp, null);
                        if (isKnownEndpoint(endpoint, endpointClasses)) {
                            c = comp;
                            break;
                        }
View Full Code Here

            String uri = NamespaceHelper.createDiscoveryPathName(namespaceURI);
            Properties props = PropertiesLoaderUtils.loadAllProperties(uri);
            String compClassName = props.getProperty("component");
            if (compClassName != null) {
                Class compClass = ClassUtils.forName(compClassName);
                Component comp = (Component) BeanUtils.instantiateClass(compClass);
                Class[] endpointClasses = (Class[]) getEndpointClassesMethod.invoke(comp, null);
                if (isKnownEndpoint(endpoint, endpointClasses)) {
                    String name = chooseComponentName(comp);
                    activateComponent(comp, name);
                    components.put(name, comp);
View Full Code Here

        Object bean = activationSpec.getComponent();
        if (bean == null) {
            throw new IllegalArgumentException("A Registration must have a component associated with it");
        }
        if (bean instanceof Component) {
            Component component = (Component) bean;
            if (component instanceof ComponentSupport) {
                defaultComponentServiceAndEndpoint((ComponentSupport) component, activationSpec);
            }
            activateComponent(component, activationSpec);
            return component;
        } else if (bean instanceof ComponentLifeCycle) {
            // lets support just plain lifecycle pojos
            ComponentLifeCycle lifeCycle = (ComponentLifeCycle) bean;
            if (bean instanceof PojoSupport) {
                defaultComponentServiceAndEndpoint((PojoSupport) bean, activationSpec);
            }
            Component adaptor = createComponentAdaptor(lifeCycle, activationSpec);
            activateComponent(adaptor, activationSpec);
            return adaptor;
        } else if (bean instanceof MessageExchangeListener) {
            // lets support just plain listener pojos
            MessageExchangeListener listener = (MessageExchangeListener) bean;
            Component adaptor = createComponentAdaptor(listener, activationSpec);
            activateComponent(adaptor, activationSpec);
            return adaptor;
        } else {
            throw new IllegalArgumentException("Component name: " + id
                            + " is bound to an object which is not a JBI component, it is of type: " + bean.getClass().getName());
View Full Code Here

            for (Iterator it = endpoints.entrySet().iterator(); it.hasNext();) {
                Map.Entry e = (Map.Entry) it.next();
                List l = (List) e.getValue();
                for (Iterator itEp = l.iterator(); itEp.hasNext();) {
                    Object endpoint = itEp.next();
                    Component c = endpointToComponent.remove(endpoint);
                    ((DefaultComponent) c).removeEndpoint((Endpoint) endpoint);
                }
            }
        }
        // Deactivate components
View Full Code Here

            Map.Entry e = (Map.Entry) it.next();
            String key = (String) e.getKey();
            List l = (List) e.getValue();
            for (Iterator itEp = l.iterator(); itEp.hasNext();) {
                Object endpoint = itEp.next();
                Component c = null;
                if (key.length() > 0) {
                    Component comp = (Component) components.get(key);
                    if (comp == null) {
                        throw new JBIException("Could not find component '" + key + "' specified for endpoint");
                    }
                    c = comp;
                } else {
                    for (Iterator itCmp = components.values().iterator(); itCmp.hasNext();) {
                        Component comp = (Component) itCmp.next();
                        Class[] endpointClasses = (Class[]) getEndpointClassesMethod.invoke(comp, null);
                        if (isKnownEndpoint(endpoint, endpointClasses)) {
                            c = comp;
                            break;
                        }
View Full Code Here

            String uri = NamespaceHelper.createDiscoveryPathName(namespaceURI);
            Properties props = PropertiesLoaderUtils.loadAllProperties(uri);
            String compClassName = props.getProperty("component");
            if (compClassName != null) {
                Class compClass = ClassUtils.forName(compClassName);
                Component comp = (Component) BeanUtils.instantiateClass(compClass);
                Class[] endpointClasses = (Class[]) getEndpointClassesMethod.invoke(comp, null);
                if (isKnownEndpoint(endpoint, endpointClasses)) {
                    String name = chooseComponentName(comp);
                    getContainer().activateComponent(comp, name);
                    components.put(name, comp);
View Full Code Here

TOP

Related Classes of javax.jbi.component.Component

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.