Package org.apache.servicemix.jbi.framework

Examples of org.apache.servicemix.jbi.framework.ComponentNameSpace


    /*
     * Test method for 'org.apache.servicemix.jbi.framework.ComponentNameSpace.copy()'
     */
    public void testCopy() {
        ComponentNameSpace cns1 = new ComponentNameSpace("container", "name");
        ComponentNameSpace cns2 = cns1.copy();
        assertEquals(cns1, cns1);
        assertEquals(cns1.getName(), cns2.getName());
    }
View Full Code Here


     * @return the ObjectName of the MBean for the Component
     * @throws JBIException
     */
    public ObjectName activateComponent(Component component, String componentName) throws JBIException {
        ActivationSpec activationSpec = new ActivationSpec();
        ComponentNameSpace cns = new ComponentNameSpace(getName(), componentName);
        activationSpec.setComponent(component);
        activationSpec.setComponentName(cns.getName());
        return activateComponent(component, activationSpec);
    }
View Full Code Here

     * @return the ObjectName of the Component's MBean
     * @throws JBIException
     */
    public ObjectName activateComponent(File installDir, Component component, String description, ComponentContextImpl context,
                    boolean binding, boolean service, String[] sharedLibraries) throws JBIException {
        ComponentNameSpace cns = context.getComponentNameSpace();
        ActivationSpec activationSpec = new ActivationSpec();
        activationSpec.setComponent(component);
        activationSpec.setComponentName(cns.getName());
        return activateComponent(installDir, component, description, context, activationSpec, false, binding, service, sharedLibraries);
    }
View Full Code Here

     * @return the ObjectName of the Component's MBean
     * @throws JBIException
     */
    public ObjectName activateComponent(Component component, String description, ActivationSpec activationSpec, boolean pojo,
                    boolean binding, boolean service, String[] sharedLibraries) throws JBIException {
        ComponentNameSpace cns = new ComponentNameSpace(getName(), activationSpec.getComponentName());
        if (registry.getComponent(cns) != null) {
            throw new JBIException("A component is already registered for " + cns);
        }
        ComponentContextImpl context = new ComponentContextImpl(this, cns);
        return activateComponent(new File("."), component, description, context, activationSpec, pojo, binding, service, sharedLibraries);
View Full Code Here

    public ObjectName activateComponent(File installationDir, Component component,
                                       String description, ComponentContextImpl context,
                                       ActivationSpec activationSpec, boolean pojo,
                                       boolean binding, boolean service, String[] sharedLibraries) throws JBIException {
        ObjectName result = null;
        ComponentNameSpace cns = new ComponentNameSpace(getName(), activationSpec.getComponentName());
        if (LOG.isDebugEnabled()) {
            LOG.info("Activating component for: " + cns + " with service: " + activationSpec.getService() + " component: " + component);
        }
        ComponentMBeanImpl lcc = registry.registerComponent(cns, description, component, binding, service, sharedLibraries);
        if (lcc != null) {
View Full Code Here

     *
     * @param packet
     * @throws MessagingException
     */
    protected void doRouting(MessageExchangeImpl me) throws MessagingException {
        ComponentNameSpace id = me.getRole() == Role.PROVIDER ? me.getDestinationId() : me.getSourceId();
        //As the MessageExchange could come from another container - ensure we get the local Component
        ComponentMBeanImpl lcc = broker.getContainer().getRegistry().getComponent(id.getName());
        if (lcc != null) {
            if (lcc.getDeliveryChannel() != null) {
                try {
                    lock.readLock().lock();
                    lcc.getDeliveryChannel().processInBound(me);
                } finally {
                    lock.readLock().unlock();
                }
            } else {
                throw new MessagingException("Component " + id.getName() + " is shut down");
            }
        } else {
            throw new MessagingException("No component named " + id.getName() + " - Couldn't route MessageExchange " + me);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.servicemix.jbi.framework.ComponentNameSpace

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.