1 package org.objectweb.celtix.jbi.transport; 2 3 import java.io.IOException ; 4 import java.util.logging.Logger ; 5 6 import javax.jbi.messaging.DeliveryChannel; 7 import javax.wsdl.WSDLException; 8 9 import org.objectweb.celtix.Bus; 10 import org.objectweb.celtix.bindings.ClientBinding; 11 import org.objectweb.celtix.bindings.ResponseCallback; 12 import org.objectweb.celtix.jbi.se.CeltixServiceUnitManager; 13 import org.objectweb.celtix.transports.ClientTransport; 14 import org.objectweb.celtix.transports.ServerTransport; 15 import org.objectweb.celtix.transports.TransportFactory; 16 import org.objectweb.celtix.ws.addressing.EndpointReferenceType; 17 18 21 public class JBITransportFactory implements TransportFactory { 22 23 private static final Logger LOG = Logger.getLogger(JBITransportFactory.class.getName()); 24 25 private CeltixServiceUnitManager suManager; 26 private DeliveryChannel deliveryChannel; 27 28 public void init(Bus b) { 29 } 30 31 32 33 public DeliveryChannel getDeliveryChannel() { 34 return deliveryChannel; 35 } 36 37 public void setDeliveryChannel(DeliveryChannel newDeliverychannel) { 38 LOG.fine("configuring DeliveryChannel: " + newDeliverychannel); 39 deliveryChannel = newDeliverychannel; 40 } 41 42 public CeltixServiceUnitManager getServiceUnitManager() { 43 return suManager; 44 } 45 46 public void setServiceUnitManager(CeltixServiceUnitManager sum) { 47 if (sum == null) { 48 Thread.dumpStack(); 49 } 50 LOG.fine("configuring ServiceUnitManager: " + sum); 51 suManager = sum; 52 } 53 54 55 public ServerTransport createServerTransport(EndpointReferenceType address) 56 throws WSDLException, IOException { 57 LOG.info("creating JBI server transport"); 58 59 if (suManager == null || deliveryChannel == null) { 60 LOG.severe("JBITransportFactory is not properly initialised"); 61 LOG.severe("CeltixServiceUnitManager: " + suManager); 62 LOG.severe("DeliveryChannel: " + deliveryChannel); 63 throw new IllegalStateException ("JBITransport factory not fully initalised"); 64 } 65 66 return new JBIServerTransport(suManager, deliveryChannel); 67 } 68 69 public ServerTransport createTransientServerTransport(EndpointReferenceType address) 70 throws WSDLException, IOException { 71 72 throw new RuntimeException ("not yet implemented"); 73 } 74 75 76 public ClientTransport createClientTransport(EndpointReferenceType address, 77 ClientBinding binding) 78 throws WSDLException, IOException { 79 80 LOG.info("creating JBI client transport"); 81 82 if (deliveryChannel == null) { 83 LOG.severe("JBITransportFactory is not properly initialised"); 84 LOG.severe("DeliveryChannel: " + deliveryChannel); 85 throw new IllegalStateException ("JBITransport factory not fully initalised"); 86 } 87 88 return new JBIClientTransport(deliveryChannel, address, binding); 89 } 90 91 92 93 public void setResponseCallback(ResponseCallback callback) { 94 throw new RuntimeException ("not yet implemented"); 95 } 96 } 97 | Popular Tags |