1 package org.jacorb.events; 2 3 22 23 import org.omg.CosEventComm.*; 24 import org.omg.CosEventChannelAdmin.*; 25 import org.omg.PortableServer.*; 26 import org.omg.CORBA.*; 27 import org.jacorb.orb.*; 28 29 46 public class ProxyPushConsumerImpl 47 extends org.omg.CosEventChannelAdmin.ProxyPushConsumerPOA 48 { 49 private EventChannelImpl myEventChannel; 50 private PushSupplier myPushSupplier; 51 private org.omg.PortableServer.POA myPoa; 52 private boolean connected; 53 54 57 protected ProxyPushConsumerImpl ( EventChannelImpl ec, 58 org.omg.CORBA.ORB orb, 59 org.omg.PortableServer.POA poa ) 60 { 61 myEventChannel = ec; 62 myPoa = poa; 63 connected = false; 64 _this_object( orb ); 65 } 66 67 76 public void connect_push_supplier ( PushSupplier pushSupplier ) 77 throws org.omg.CosEventChannelAdmin.AlreadyConnected 78 { 79 if ( connected ) { throw new org.omg.CosEventChannelAdmin.AlreadyConnected(); } 80 myPushSupplier = pushSupplier; 81 connected = true; 82 } 83 84 97 public void disconnect_push_consumer() 98 { 99 if ( connected ) 100 { 101 if ( myPushSupplier != null ) 102 { 103 myPushSupplier.disconnect_push_supplier(); 104 myPushSupplier = null; 105 } 106 connected = false; 107 } 108 else 109 { 110 throw new org.omg.CORBA.OBJECT_NOT_EXIST (); 111 } 112 } 113 114 117 public void push (org.omg.CORBA.Any event ) 118 throws org.omg.CosEventComm.Disconnected 119 { 120 if ( !connected ) { throw new org.omg.CosEventComm.Disconnected(); } 121 myEventChannel.push_event( event ); 122 } 123 124 130 public org.omg.PortableServer.POA _default_POA() 131 { 132 return myPoa; 133 } 134 } 135 | Popular Tags |