void TAO_CEC_ProxyPullSupplier::connect_pull_consumer ( CosEventComm::PullConsumer_ptr pull_consumer) { { ACE_GUARD_THROW_EX ( ACE_Lock, ace_mon, *this->lock_, CORBA::INTERNAL ()); // @@ CosEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ()); if (this->is_connected_i ()) { if (this->event_channel_->consumer_reconnect () == 0) throw CosEventChannelAdmin::AlreadyConnected (); // Re-connections are allowed.... this->cleanup_i (); this->consumer_ = apply_policy (pull_consumer); this->connected_ = 1; TAO_CEC_Unlock reverse_lock (*this->lock_); { ACE_GUARD_THROW_EX ( TAO_CEC_Unlock, ace_mon, reverse_lock, CORBA::INTERNAL ()); // @@ CosEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ()); this->event_channel_->reconnected (this); } return; } this->consumer_ = apply_policy (pull_consumer); this->connected_ = 1; } // Notify the event channel... this->event_channel_->connected (this); }
void TAO_CEC_ProxyPushConsumer::connect_push_supplier ( CosEventComm::PushSupplier_ptr push_supplier) { { ACE_GUARD_THROW_EX ( ACE_Lock, ace_mon, *this->lock_, CORBA::INTERNAL ()); // @@ CosEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ()); if (this->is_connected_i ()) { if (this->event_channel_->supplier_reconnect () == 0) throw CosEventChannelAdmin::AlreadyConnected (); // Re-connections are allowed, go ahead and disconnect the // consumer... this->cleanup_i (); // @@ Please read the comments in CEC_ProxyPushSupplier about // possible race conditions in this area... TAO_CEC_Unlock reverse_lock (*this->lock_); { ACE_GUARD_THROW_EX ( TAO_CEC_Unlock, ace_mon, reverse_lock, CORBA::INTERNAL ()); // @@ CosEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ()); this->event_channel_->disconnected (this); } // What if a second thread connected us after this? if (this->is_connected_i ()) return; } this->supplier_ = apply_policy (push_supplier); this->connected_ = true; } // Notify the event channel... this->event_channel_->connected (this); }
CipherText::CipherText(Policy* policy, element_t* m, PubParam* pub, pairing_t* p){ this->pub = pub; this->p = p; this->m = m; this->policy = policy; //init random s this->s = (element_t*)malloc(sizeof(element_t)); element_init_Zr(*(this->s),*(this->p)); element_random(*(this->s)); // printf("excute before init_c1\n"); //init c1 init_c1(); // printf("ciphertext::init_c1() ok\n"); //init c0 init_c0(); // printf("ciphertext::init_c0() ok\n"); apply_policy(); printf("ciphertext: apply_policy ok\n"); }
void TAO_CEC_ProxyPushSupplier::connect_push_consumer ( CosEventComm::PushConsumer_ptr push_consumer) { // Nil PushConsumers are illegal if (CORBA::is_nil (push_consumer)) throw CORBA::BAD_PARAM (); { #if defined (TAO_HAS_TYPED_EVENT_CHANNEL) // Check if we have a typed event channel if (this->is_typed_ec () ) { if (TAO_debug_level >= 10) { ORBSVCS_DEBUG ((LM_DEBUG, ACE_TEXT ("***** connect_push_consumer, ") ACE_TEXT ("Event channel is typed *****\n"))); } // Temporary for the TypedPushConsumer and it's Typed interface, // declared and obtained before the Guard to avoid deadlock during the // _is_a (during _narrow) and get_typed_consumer invocations. // They are eventually assigned onto this object inside the Guard. CosTypedEventComm::TypedPushConsumer_var local_typed_consumer = CosTypedEventComm::TypedPushConsumer::_narrow (push_consumer); // Obtain the typed object interface from the consumer CORBA::Object_var local_typed_consumer_obj = CORBA::Object::_duplicate (local_typed_consumer->get_typed_consumer () ); { ACE_GUARD_THROW_EX ( ACE_Lock, ace_mon, *this->lock_, CORBA::INTERNAL ()); // @@ CosEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ()); if (this->is_connected_i ()) { if (this->typed_event_channel_->consumer_reconnect () == 0) throw CosEventChannelAdmin::AlreadyConnected (); // Re-connections are allowed.... this->cleanup_i (); this->typed_consumer_ = apply_policy (local_typed_consumer.in () ); TAO_CEC_Unlock reverse_lock (*this->lock_); { ACE_GUARD_THROW_EX ( TAO_CEC_Unlock, ace_mon, reverse_lock, CORBA::INTERNAL ()); // @@ CosEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ()); this->typed_event_channel_->reconnected (this); } return; } this->typed_consumer_ = apply_policy (local_typed_consumer.in () ); // Store the typed object interface from the consumer this->typed_consumer_obj_ = apply_policy_obj (local_typed_consumer_obj.in () ); } // Notify the event channel... this->typed_event_channel_->connected (this); } /* this->is_typed_ec */ else { #endif /* TAO_HAS_TYPED_EVENT_CHANNEL */ if (TAO_debug_level >= 10) { ORBSVCS_DEBUG ((LM_DEBUG, ACE_TEXT ("***** connect_push_consumer, ") ACE_TEXT ("Event channel is un-typed *****\n"))); } { ACE_GUARD_THROW_EX ( ACE_Lock, ace_mon, *this->lock_, CORBA::INTERNAL ()); // @@ CosEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ()); if (this->is_connected_i ()) { if (this->event_channel_->consumer_reconnect () == 0) throw CosEventChannelAdmin::AlreadyConnected (); // Re-connections are allowed.... this->cleanup_i (); this->consumer_ = apply_policy (push_consumer); TAO_CEC_Unlock reverse_lock (*this->lock_); { ACE_GUARD_THROW_EX ( TAO_CEC_Unlock, ace_mon, reverse_lock, CORBA::INTERNAL ()); // @@ CosEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ()); this->event_channel_->reconnected (this); } return; } this->consumer_ = apply_policy (push_consumer); } // Notify the event channel... this->event_channel_->connected (this); #if defined (TAO_HAS_TYPED_EVENT_CHANNEL) } /* ! this->is_typed_ec */ #endif /* TAO_HAS_TYPED_EVENT_CHANNEL */ } }