1 package org.jacorb.events; 2 3 22 23 import org.omg.CosEventComm.*; 24 import org.omg.CosEventChannelAdmin.*; 25 import org.omg.CORBA.*; 26 import org.omg.PortableServer.*; 27 import org.jacorb.orb.*; 28 29 45 public class ProxyPushSupplierImpl 46 extends org.omg.CosEventChannelAdmin.ProxyPushSupplierPOA 47 { 48 private EventChannelImpl myEventChannel; 49 private PushConsumer myPushConsumer; 50 private org.omg.PortableServer.POA myPoa; 51 private boolean connected; 52 53 56 protected ProxyPushSupplierImpl ( EventChannelImpl ec, 57 org.omg.CORBA.ORB orb, 58 org.omg.PortableServer.POA poa ) 59 { 60 myEventChannel = ec; 61 myPoa = poa; 62 connected = false; 63 _this_object( orb ); 64 } 65 66 75 public void connect_push_consumer ( PushConsumer pushConsumer ) 76 throws org.omg.CosEventChannelAdmin.AlreadyConnected, 77 org.omg.CORBA.BAD_PARAM 78 { 79 if ( connected ) { throw new org.omg.CosEventChannelAdmin.AlreadyConnected(); } 80 if ( pushConsumer == null ) { throw new org.omg.CORBA.BAD_PARAM (); } 81 82 myPushConsumer = pushConsumer; 83 connected = true; 84 } 85 86 99 public void disconnect_push_supplier() 100 { 101 if ( connected ) 102 { 103 if ( myPushConsumer != null ) 104 { 105 myPushConsumer.disconnect_push_consumer(); 106 myPushConsumer = null; 107 } 108 connected = false; 109 } 110 else 111 { 112 throw new OBJECT_NOT_EXIST(); 113 } 114 } 115 116 117 120 protected void push_to_consumer(org.omg.CORBA.Any event ) 121 { 122 if ( connected ) 123 { 124 try 125 { 126 myPushConsumer.push ( event ); 127 } 128 catch( Disconnected e ) 129 { 130 connected = false; 131 } 132 } 133 } 134 135 141 public org.omg.PortableServer.POA _default_POA() 142 { 143 return myPoa; 144 } 145 } | Popular Tags |