1 package org.jacorb.notification.servant; 2 3 23 24 import org.apache.avalon.framework.configuration.Configuration; 25 import org.jacorb.notification.MessageFactory; 26 import org.jacorb.notification.OfferManager; 27 import org.jacorb.notification.SubscriptionManager; 28 import org.jacorb.notification.engine.TaskProcessor; 29 import org.omg.CORBA.ORB ; 30 import org.omg.CosEventChannelAdmin.AlreadyConnected; 31 import org.omg.CosEventComm.Disconnected; 32 import org.omg.CosNotification.StructuredEvent; 33 import org.omg.CosNotifyChannelAdmin.ProxyType; 34 import org.omg.CosNotifyChannelAdmin.SequenceProxyPushConsumerOperations; 35 import org.omg.CosNotifyChannelAdmin.SequenceProxyPushConsumerPOATie; 36 import org.omg.CosNotifyChannelAdmin.SupplierAdmin; 37 import org.omg.CosNotifyComm.SequencePushSupplier; 38 import org.omg.PortableServer.POA ; 39 import org.omg.PortableServer.Servant ; 40 41 45 46 public class SequenceProxyPushConsumerImpl extends StructuredProxyPushConsumerImpl implements 47 SequenceProxyPushConsumerOperations 48 { 49 private SequencePushSupplier sequencePushSupplier_; 50 51 53 public SequenceProxyPushConsumerImpl(IAdmin admin, ORB orb, POA poa, Configuration conf, 54 TaskProcessor taskProcessor, MessageFactory mf, SupplierAdmin supplierAdmin, 55 OfferManager offerManager, SubscriptionManager subscriptionManager) 56 { 57 super(admin, orb, poa, conf, taskProcessor, mf, supplierAdmin, offerManager, 58 subscriptionManager); 59 } 60 61 public ProxyType MyType() 62 { 63 return ProxyType.PUSH_SEQUENCE; 64 } 65 66 protected void disconnectClient() 67 { 68 logger_.info("disconnect sequence_push_supplier"); 69 70 sequencePushSupplier_.disconnect_sequence_push_supplier(); 71 72 sequencePushSupplier_ = null; 73 } 74 75 public void connect_sequence_push_supplier(SequencePushSupplier supplier) 76 throws AlreadyConnected 77 { 78 checkIsNotConnected(); 79 80 connectClient(supplier); 81 82 sequencePushSupplier_ = supplier; 83 84 logger_.info("connect sequence_push_supplier"); 85 } 86 87 public void push_structured_events(StructuredEvent[] events) throws Disconnected 88 { 89 checkStillConnected(); 90 91 for (int x = 0; x < events.length; ++x) 92 { 93 push_structured_event(events[x]); 94 } 95 } 96 97 public void disconnect_sequence_push_consumer() 98 { 99 destroy(); 100 } 101 102 public synchronized Servant getServant() 103 { 104 if (thisServant_ == null) 105 { 106 thisServant_ = new SequenceProxyPushConsumerPOATie(this); 107 } 108 109 return thisServant_; 110 } 111 } | Popular Tags |