blob: fc6e8e6a6d16e1280838c6c8caa7e132e789264f (
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
|
// -*- C++ -*-
//=============================================================================
/**
* @file Deployment_Configuration.h
*
* $Id$
*
* The Deployment_Configuration provides abstraction for the
* deployment mechanisms.
*
* @author Nanbor Wang <nanbor@cs.wustl.edu>
*/
//=============================================================================
#ifndef CIAO_DEPLOYMENT_CONFIGURATION_H
#define CIAO_DEPLOYMENT_CONFIGURATION_H
#include /**/ "ace/pre.h"
#include "ace/Hash_Map_Manager_T.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
#include "CCM_DeploymentC.h"
namespace CIAO
{
/**
* @class Deployment_Configuration
*
* @brief A class that provides strategies on deployment topology
*
* This class provides strategies on how the Assembly framework
* should deploy an assembly. This is achieved by providing
* mappings from deployment destination names to actually CIAO daemon
* IORs, and the strategy for which default CIAO daemon a deployment
* mechanism should use.
*
* This is a trivial implementation of the deployment configuration
* strategy. We can enhance this class later on to provide
* different deployment location strategies.
*/
class Deployment_Configuration
{
public:
typedef struct _activator_info
{
_activator_info (const char *ior = 0)
{
IOR_ = ior;
}
ACE_CString IOR_;
Components::Deployment::ServerActivator_var activator_;
} Activator_Info;
Deployment_Configuration (CORBA::ORB_ptr o);
/// Destructor
virtual ~Deployment_Configuration (void);
/**
* Init method takes the filename to a configuration file which
* has a simple line format of name, ior string delimited by a
* space in each line.
*
* name IOR-string
*
* @retval 0 on success.
* @retval -1 otherwise.
*/
int init (const char *filename);
/**
* @retval 0 if no valid name were found.
*/
virtual const char *get_activator_ior (const char *name);
/**
* Return the default ServerActivator the Assembly mechanism
* should use to deploy a component. In this implementation, the
* first entry in the deployment configuration data file is always
* the entry for default activator.
*
* @retval 0 if no valid daemon is configured.
*/
virtual const char *get_default_activator_ior (void);
/**
* @retval nil if no valid name were found.
*/
virtual Components::Deployment::ServerActivator_ptr
get_activator (const char *name);
/**
* Return the reference to the default ServerActivator the
* Assembly mechanism should use to deploy a component.
*
* @retval nil if no valid daemon is configured.
*/
virtual Components::Deployment::ServerActivator_ptr
get_default_activator (void);
protected:
CORBA::ORB_var orb_;
ACE_Hash_Map_Manager_Ex<ACE_CString,
Activator_Info,
ACE_Hash<ACE_CString>,
ACE_Equal_To<ACE_CString>,
ACE_Null_Mutex> deployment_info_;
Activator_Info default_activator_;
};
}
#if defined (__ACE_INLINE__)
# include "Deployment_Configuration.inl"
#endif /* __ACE_INLINE__ */
#include /**/ "ace/post.h"
#endif /* CIAO_DEPLOYMENT_CONFIGURATION_H */
|