1 package org.jacorb.notification.servant; 2 3 22 23 import org.apache.avalon.framework.configuration.Configuration; 24 import org.jacorb.notification.MessageFactory; 25 import org.jacorb.notification.OfferManager; 26 import org.jacorb.notification.SubscriptionManager; 27 import org.jacorb.notification.util.CollectionsWrapper; 28 import org.omg.CORBA.INTERNAL ; 29 import org.omg.CORBA.IntHolder ; 30 import org.omg.CORBA.NO_IMPLEMENT ; 31 import org.omg.CORBA.ORB ; 32 import org.omg.CosNotifyChannelAdmin.AdminLimitExceeded; 33 import org.omg.CosTypedNotifyChannelAdmin.TypedProxyPullConsumer; 34 import org.omg.CosTypedNotifyChannelAdmin.TypedProxyPullConsumerHelper; 35 import org.omg.CosTypedNotifyChannelAdmin.TypedProxyPushConsumer; 36 import org.omg.CosTypedNotifyChannelAdmin.TypedProxyPushConsumerHelper; 37 import org.omg.CosTypedNotifyChannelAdmin.TypedSupplierAdmin; 38 import org.omg.CosTypedNotifyChannelAdmin.TypedSupplierAdminHelper; 39 import org.omg.CosTypedNotifyChannelAdmin.TypedSupplierAdminOperations; 40 import org.omg.CosTypedNotifyChannelAdmin.TypedSupplierAdminPOATie; 41 import org.omg.PortableServer.POA ; 42 import org.omg.PortableServer.Servant ; 43 import org.picocontainer.MutablePicoContainer; 44 45 49 public class TypedSupplierAdminImpl extends SupplierAdminImpl implements 50 TypedSupplierAdminOperations 51 { 52 private final TypedSupplierAdmin thisRef_; 53 54 public TypedSupplierAdminImpl(IEventChannel channelServant, ORB orb, POA poa, 55 Configuration config, MessageFactory messageFactory, OfferManager offerManager, 56 SubscriptionManager subscriptionManager) 57 { 58 super(channelServant, orb, poa, config, messageFactory, offerManager, subscriptionManager); 59 60 thisRef_ = TypedSupplierAdminHelper.narrow(getServant()._this_object(getORB())); 61 } 62 63 protected Servant createServant() 64 { 65 return new TypedSupplierAdminPOATie(this); 66 } 67 68 public org.omg.CORBA.Object activate() 69 { 70 return thisRef_; 71 } 72 73 public TypedProxyPushConsumer obtain_typed_notification_push_consumer(String type, IntHolder id) 74 throws AdminLimitExceeded 75 { 76 fireCreateProxyRequestEvent(); 77 78 try 79 { 80 final MutablePicoContainer _containerForProxy = newContainerForTypedProxy(type); 81 82 _containerForProxy.registerComponent(newComponentAdapter( 83 TypedProxyPushConsumerImpl.class, TypedProxyPushConsumerImpl.class)); 84 85 TypedProxyPushConsumerImpl _servant = (TypedProxyPushConsumerImpl) _containerForProxy 86 .getComponentInstance(TypedProxyPushConsumerImpl.class); 87 88 _servant.setSubsequentDestinations(CollectionsWrapper.singletonList(this)); 89 90 configureInterFilterGroupOperator(_servant); 91 92 configureQoS(_servant); 93 94 addProxyToMap(_servant, pushServants_, modifyProxiesLock_); 95 96 id.value = _servant.getID().intValue(); 97 98 return TypedProxyPushConsumerHelper.narrow(_servant.activate()); 99 } catch (Exception e) 100 { 101 logger_.error("unable to create typed notification push consumer", e); 102 throw new INTERNAL (); 103 } 104 } 105 106 public TypedProxyPullConsumer obtain_typed_notification_pull_consumer(String type, IntHolder id) 107 throws AdminLimitExceeded 108 { 109 fireCreateProxyRequestEvent(); 110 111 try 112 { 113 final MutablePicoContainer _containerForProxy = newContainerForTypedProxy(type); 114 115 _containerForProxy.registerComponent(newComponentAdapter( 116 TypedProxyPullConsumerImpl.class, TypedProxyPullConsumerImpl.class)); 117 118 TypedProxyPullConsumerImpl _servant = (TypedProxyPullConsumerImpl) _containerForProxy 119 .getComponentInstance(TypedProxyPullConsumerImpl.class); 120 121 configureInterFilterGroupOperator(_servant); 122 123 configureQoS(_servant); 124 125 addProxyToMap(_servant, pullServants_, modifyProxiesLock_); 126 127 id.value = _servant.getID().intValue(); 128 129 return TypedProxyPullConsumerHelper.narrow(_servant.activate()); 130 } catch (Exception e) 131 { 132 logger_.error("unable to create typed notification push consumer", e); 133 134 throw new INTERNAL (); 135 } 136 } 137 138 public org.omg.CosTypedEventChannelAdmin.TypedProxyPushConsumer obtain_typed_push_consumer( 139 String type) 140 { 141 throw new NO_IMPLEMENT (); 142 } 143 144 public org.omg.CosEventChannelAdmin.ProxyPullConsumer obtain_typed_pull_consumer(String type) 145 { 146 throw new NO_IMPLEMENT (); 147 } 148 } | Popular Tags |