blob: 5c1140577f70f11bd689c7653319f0bff33a1866 (
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
// $Id$
#include "orbsvcs/Notify/Sequence/SequenceProxyPushSupplier.h"
ACE_RCSID (Notify, TAO_Notify_SequenceProxyPushSupplier, "$Id$")
#include "tao/debug.h"
#include "orbsvcs/Notify/Sequence/SequencePushConsumer.h"
#include "orbsvcs/Notify/Properties.h"
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
TAO_Notify_SequenceProxyPushSupplier::TAO_Notify_SequenceProxyPushSupplier (void)
{
}
TAO_Notify_SequenceProxyPushSupplier::~TAO_Notify_SequenceProxyPushSupplier ()
{
}
void
TAO_Notify_SequenceProxyPushSupplier::release (void)
{
delete this;
//@@ inform factory
}
void
TAO_Notify_SequenceProxyPushSupplier::connect_sequence_push_consumer (CosNotifyComm::SequencePushConsumer_ptr push_consumer ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((
CORBA::SystemException
, CosEventChannelAdmin::AlreadyConnected
, CosEventChannelAdmin::TypeError
))
{
// Convert Consumer to Base Type
TAO_Notify_SequencePushConsumer* consumer;
ACE_NEW_THROW_EX (consumer,
TAO_Notify_SequencePushConsumer (this),
CORBA::NO_MEMORY ());
consumer->init (push_consumer ACE_ENV_ARG_PARAMETER);
this->connect (consumer ACE_ENV_ARG_PARAMETER);
this->self_change ();
}
void
TAO_Notify_SequenceProxyPushSupplier::disconnect_sequence_push_supplier (void)
ACE_THROW_SPEC ((
CORBA::SystemException
))
{
TAO_Notify_SequenceProxyPushSupplier::Ptr guard( this );
this->destroy ();
this->self_change ();
}
CosNotifyChannelAdmin::ProxyType
TAO_Notify_SequenceProxyPushSupplier::MyType (void)
ACE_THROW_SPEC ((
CORBA::SystemException
))
{
return CosNotifyChannelAdmin::PUSH_SEQUENCE;
}
const char *
TAO_Notify_SequenceProxyPushSupplier::get_proxy_type_name (void) const
{
return "sequence_proxy_push_supplier";
}
void
TAO_Notify_SequenceProxyPushSupplier::load_attrs (const TAO_Notify::NVPList& attrs)
{
SuperClass::load_attrs(attrs);
ACE_CString ior;
if (attrs.load("PeerIOR", ior))
{
CORBA::ORB_var orb = TAO_Notify_PROPERTIES::instance()->orb();
ACE_DECLARE_NEW_CORBA_ENV;
ACE_TRY
{
CosNotifyComm::SequencePushConsumer_var pc = CosNotifyComm::SequencePushConsumer::_nil();
if (ior.length() > 0)
{
CORBA::Object_var obj = orb->string_to_object(ior.c_str() ACE_ENV_ARG_PARAMETER);
pc = CosNotifyComm::SequencePushConsumer::_unchecked_narrow(obj.in() ACE_ENV_ARG_PARAMETER);
}
this->connect_sequence_push_consumer(pc.in() ACE_ENV_ARG_PARAMETER);
}
ACE_CATCHANY
{
// if we can't reconnect, tough
}
ACE_ENDTRY;
}
}
TAO_END_VERSIONED_NAMESPACE_DECL
|