1 17 package org.apache.servicemix.jsr181; 18 19 import javax.jbi.messaging.DeliveryChannel; 20 import javax.jbi.messaging.ExchangeStatus; 21 import javax.jbi.messaging.MessageExchange; 22 import javax.jbi.messaging.MessageExchangeFactory; 23 import javax.jbi.messaging.MessagingException; 24 import javax.jbi.servicedesc.ServiceEndpoint; 25 import javax.xml.namespace.QName ; 26 27 35 public class EndpointDeliveryChannel implements DeliveryChannel { 36 37 private final DeliveryChannel channel; 38 39 public EndpointDeliveryChannel(DeliveryChannel channel) { 40 this.channel = channel; 41 } 42 43 public MessageExchange accept() throws MessagingException { 44 throw new UnsupportedOperationException (); 45 } 46 47 public MessageExchange accept(long timeout) throws MessagingException { 48 throw new UnsupportedOperationException (); 49 } 50 51 public void close() throws MessagingException { 52 throw new UnsupportedOperationException (); 53 } 54 55 public MessageExchangeFactory createExchangeFactory() { 56 return channel.createExchangeFactory(); 57 } 58 59 public MessageExchangeFactory createExchangeFactory(QName interfaceName) { 60 return channel.createExchangeFactory(interfaceName); 61 } 62 63 public MessageExchangeFactory createExchangeFactory(ServiceEndpoint endpoint) { 64 return channel.createExchangeFactory(endpoint); 65 } 66 67 public MessageExchangeFactory createExchangeFactoryForService(QName serviceName) { 68 return channel.createExchangeFactoryForService(serviceName); 69 } 70 71 public void send(MessageExchange exchange) throws MessagingException { 72 if (exchange.getStatus() == ExchangeStatus.ACTIVE) { 73 throw new UnsupportedOperationException ("Asynchonous send of active exchanges are not supported"); 74 } 75 channel.send(exchange); 76 } 77 78 public boolean sendSync(MessageExchange exchange, long timeout) throws MessagingException { 79 return channel.sendSync(exchange, timeout); 80 } 81 82 public boolean sendSync(MessageExchange exchange) throws MessagingException { 83 return channel.sendSync(exchange); 84 } 85 } 86 | Popular Tags |