summaryrefslogtreecommitdiff
path: root/orbsvcs/tests/Notify/lib/Relay_Consumer.cpp
blob: 252d400bd7b9a387a73880bf3f4278cfd463d65e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// $Id$

#include "Relay_Consumer.h"

ACE_RCSID(Notify, TAO_Notify_Tests_Relay_Consumer, "$Id$")

#include "LookupManager.h"

TAO_Notify_Tests_Relay_Consumer::TAO_Notify_Tests_Relay_Consumer (ACE_CString& destination)
  : destination_ (destination)
{
}

TAO_Notify_Tests_Relay_Consumer::~TAO_Notify_Tests_Relay_Consumer ()
{
}

void
TAO_Notify_Tests_Relay_Consumer::connect (void)
{
  TAO_Notify_Tests_Direct_Consumer::connect ();

  // Resolve the destination object.
  LOOKUP_MANAGER->resolve (this->destination_object_, this->destination_.c_str ());
}

void
TAO_Notify_Tests_Relay_Consumer::push_structured_event (const CosNotification::StructuredEvent &notification)
{
  // The Periodic Consumer will record the run statistics.
  //TAO_Notify_Tests_Periodic_Consumer::push_structured_event (notification);

  // Forward the event.
  if (CORBA::is_nil (this->destination_object_.in ()))
    ACE_DEBUG ((LM_DEBUG, "(%P,%t) Cannot Relay - Destination object %s is nil", this->destination_.c_str ()));
  else
    this->destination_object_->push_structured_event (notification);
}