Package org.servicemix.jbi.framework

Examples of org.servicemix.jbi.framework.ComponentNameSpace


     *
     * @param packet
     * @throws MessagingException
     */
    public void doRouting(MessageExchangeImpl me) throws MessagingException {
        ComponentNameSpace id = me.getRole() == Role.PROVIDER ? me.getDestinationId() : me.getSourceId();
        ComponentConnector cc = broker.getRegistry().getLoadBalancedComponentConnector(id);
        if (cc != null) {
            if (cc.isLocal()) {
                super.doRouting(me);
            }
View Full Code Here


     *
     * @param packet
     * @throws MessagingException
     */
    public void doRouting(MessageExchangeImpl me) throws MessagingException{
        ComponentNameSpace id=me.getRole()==Role.PROVIDER?me.getDestinationId():me.getSourceId();
        ComponentConnector cc=broker.getRegistry().getComponentConnector(id);
        if(cc!=null){
            // let ActiveMQ do the routing ...
            try{
                String componentName=cc.getComponentNameSpace().getName();
                String destination = "";
                if (me.getRole() == Role.PROVIDER){
                    destination = INBOUND_PREFIX + componentName;
                }else {
                    destination = INBOUND_PREFIX + id.getContainerName();
                }
                Queue queue=inboundSession.createQueue(destination);
                ObjectMessage msg=inboundSession.createObjectMessage(me);
                queueProducer.send(queue,msg);
            }catch(JMSException e){
View Full Code Here

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

        if (filter != null) {
            result = filter.matches(exchange);
        }
        else {
            ExchangePacket packet = exchange.getPacket();
            ComponentNameSpace sourceId = packet.getSourceId();
            if (sourceId != null) {
                // get the list of services
                if (service != null) {
                    ServiceEndpoint[] ses = registry.getEndpointsForService(service);
                    if (ses != null) {
View Full Code Here

     *
     * @param packet
     * @throws MessagingException
     */
    public 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
        ComponentNameSpace copy = id.copy();
        copy.setContainerName(broker.getContainerName());
        LocalComponentConnector lcc = broker.getRegistry().getLocalComponentConnector(copy);
        if (lcc != null) {
            lcc.getDeliveryChannel().processInBound(me);
        }
        else {
View Full Code Here

import junit.framework.TestCase;

public class InternalEndpointTest extends TestCase {

    public void testSerializeDeserialize() throws Exception {
        ComponentNameSpace cns = new ComponentNameSpace("myContainer", "myName", "myId");
        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

TOP

Related Classes of org.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.