blob: ed92d5d4dc3c461885e215bbe49f542fcf389490 (
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
|
// $Id$
//=============================================================================
//
//
// = FILENAME
// MyFooServant.h
//
// = DESCRIPTION
// Defines MyFooServant class for the Foo interface
//
// = AUTHOR
// Irfan Pyarali and Michael Kircher
//
//=============================================================================
#ifndef MYFOOSERVANT_H
#define MYFOOSERVANT_H
#include "FooS.h"
#include "Servant_Locator.h"
class MyFirstFooServant : public POA_Foo, public ACE_Event_Handler
{
// = TITLE
// @@ Michael, please comment me.
public:
// constructor - takes a POA and a value parameter
MyFirstFooServant (CORBA::ORB_ptr orb_ptr,
PortableServer::POA_ptr poa_ptr,
CORBA::Long value,
CORBA::Object_ptr forward_to_ptr);
// Destructor
virtual ~MyFirstFooServant (void);
//Returns the Default POA of this Servant object
virtual PortableServer::POA_ptr _default_POA (CORBA::Environment &env);
// Simple doit method
virtual CORBA::Long doit (CORBA::Environment &env)
ACE_THROW_SPEC ((CORBA::SystemException));
// Setup forwarding
virtual void forward (CORBA::Environment &env)
ACE_THROW_SPEC ((CORBA::SystemException,
Foo::Cannot_Forward));
virtual void shutdown (CORBA::Environment &env)
ACE_THROW_SPEC ((CORBA::SystemException));
protected:
int handle_input (ACE_HANDLE);
// Default poa associated with this servant
CORBA::ORB_var orb_;
PortableServer::POA_var poa_;
CORBA::Long value_;
CORBA::Object_var forward_to_var_;
ACE_HANDLE handle_;
// Handle to dev null.
};
class MySecondFooServant : public POA_Foo
{
// = TITLE
// @@ Michael, please comment me.
public:
// constructor - takes a POA and a value parameter
MySecondFooServant (CORBA::ORB_ptr orb_ptr,
MyFooServantLocator *locator,
CORBA::Long value);
// Destructor
virtual ~MySecondFooServant (void);
// Simple doit method
virtual CORBA::Long doit (CORBA::Environment &env)
ACE_THROW_SPEC ((CORBA::SystemException));
// Setup forwarding
virtual void forward (CORBA::Environment &env)
ACE_THROW_SPEC ((CORBA::SystemException,
Foo::Cannot_Forward));
virtual void shutdown (CORBA::Environment &env)
ACE_THROW_SPEC ((CORBA::SystemException));
protected:
// Default poa associated with this servant
CORBA::ORB_var orb_;
MyFooServantLocator *locator_ptr_;
CORBA::Long value_;
};
#endif /* MYFOOSERVANT_H */
|