Package org.apache.servicemix.jbi.framework

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


     * @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

     * Put the packet in the queue for later processing.
     * @param packet
     * @throws JBIException
     */
    protected void enqueuePacket(MessageExchangeImpl me) throws JBIException {
        ComponentNameSpace cns = me.getDestinationId();
        SedaQueue queue = queueMap.get(cns);
        if (queue == null) {
            queue = createQueue(cns);
        }
        try {
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();
                    if (!me.getSourceId().getContainerName().equalsIgnoreCase(broker.getContainer().getName())
                        && broker instanceof SecuredBroker) {
                        try {
                            ((SecuredBroker)broker).checkSecurity(me);
                        } catch (Exception e) {
                            me.handleAccept();
                            me.setError(e);
                            me.handleSend(false);
                            broker.getContainer().sendExchange(me.getMirror());
                            throw new MessagingException(e);
                        }
                    }
                    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

import org.apache.servicemix.jbi.framework.ComponentNameSpace;

public class InternalEndpointTest extends TestCase {

    public void testSerializeDeserialize() throws Exception {
        ComponentNameSpace cns = new ComponentNameSpace("myContainer", "myName");
        InternalEndpoint e = new InternalEndpoint(cns, "myEndpoint", new QName("myService"));
       
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ObjectOutputStream oos = new ObjectOutputStream(baos);
        oos.writeObject(e);
View Full Code Here

        assertNotNull(outE.getServiceName());
        assertNotNull(outE.getEndpointName());
    }
   
    public void testEquals() throws Exception {
        ComponentNameSpace cns = new ComponentNameSpace("myContainer", "myName");
        InternalEndpoint e1 = new InternalEndpoint(cns, "myEndpoint1", new QName("myService"));
        InternalEndpoint e2 = new InternalEndpoint(cns, "myEndpoint2", new QName("myService"));
        assertFalse(e1.equals(e2));
        e2 = new InternalEndpoint(cns, "myEndpoint", new QName("myService2"));
        assertFalse(e1.equals(e2));
        ComponentNameSpace cns2 = new ComponentNameSpace("myContainer2", "myId2");
        e2 = new InternalEndpoint(cns2, "myEndpoint1", new QName("myService"));
        assertTrue(e1.equals(e2));
        cns2 = new ComponentNameSpace("myContainer", "myName");
        e2 = new InternalEndpoint(cns2, "myEndpoint1", new QName("myService"));
        assertTrue(e1.equals(e2));
    }
View Full Code Here

import junit.framework.TestCase;

public class InternalEndpointTest extends TestCase {

    public void testSerializeDeserialize() throws Exception {
        ComponentNameSpace cns = new ComponentNameSpace("myContainer", "myName");
        InternalEndpoint e = new InternalEndpoint(cns, "myEndpoint", new QName("myService"));
       
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ObjectOutputStream oos = new ObjectOutputStream(baos);
        oos.writeObject(e);
View Full Code Here

        assertNotNull(outE.getServiceName());
        assertNotNull(outE.getEndpointName());
    }
   
    public void testEquals() throws Exception {
        ComponentNameSpace cns = new ComponentNameSpace("myContainer", "myName");
        InternalEndpoint e1 = new InternalEndpoint(cns, "myEndpoint1", new QName("myService"));
        InternalEndpoint e2 = new InternalEndpoint(cns, "myEndpoint2", new QName("myService"));
        assertFalse(e1.equals(e2));
        e2 = new InternalEndpoint(cns, "myEndpoint", new QName("myService2"));
        assertFalse(e1.equals(e2));
        ComponentNameSpace cns2 = new ComponentNameSpace("myContainer2", "myId2");
        e2 = new InternalEndpoint(cns2, "myEndpoint1", new QName("myService"));
        assertTrue(e1.equals(e2));
        cns2 = new ComponentNameSpace("myContainer", "myName");
        e2 = new InternalEndpoint(cns2, "myEndpoint1", new QName("myService"));
        assertTrue(e1.equals(e2));
    }
View Full Code Here

    protected ServiceEndpoint[] getMatchingEndpoints(ServiceEndpoint[] endpoints, MessageExchangeImpl exchange) {
      List filtered = new ArrayList();
        ComponentMBeanImpl consumer = getRegistry().getComponent(exchange.getSourceId());
       
      for (int i = 0; i < endpoints.length; i++) {
      ComponentNameSpace id = ((InternalEndpoint) endpoints[i]).getComponentNameSpace();
            if (id != null) {
                ComponentMBeanImpl provider = getRegistry().getComponent(id);
                if (provider != null) {
                    if (!consumer.getComponent().isExchangeWithProviderOkay(endpoints[i], exchange) ||
                        !provider.getComponent().isExchangeWithConsumerOkay(endpoints[i], exchange)) {
View Full Code Here

     * Put the packet in the queue for later processing.
     * @param packet
     * @throws JBIException
     */
    protected void enqueuePacket(MessageExchangeImpl me) throws JBIException {
        ComponentNameSpace cns = me.getDestinationId();
        SedaQueue queue = (SedaQueue) queueMap.get(cns);
        if (queue == null) {
            queue = createQueue(cns);
        }
        try {
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.