~ubuntu-branches/ubuntu/quantal/zeroc-ice/quantal

« back to all changes in this revision

Viewing changes to cpp/src/IceGrid/IceGridRegistry.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Cleto Martin Angelina
  • Date: 2011-04-25 18:44:24 UTC
  • mfrom: (6.1.14 sid)
  • Revision ID: james.westby@ubuntu.com-20110425184424-sep9i9euu434vq4c
Tags: 3.4.1-7
* Bug fix: "libdb5.1-java.jar was renamed to db.jar", thanks to Ondřej
  Surý (Closes: #623555).
* Bug fix: "causes noise in php5", thanks to Jayen Ashar (Closes:
  #623533).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// **********************************************************************
2
2
//
3
 
// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
 
3
// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
4
4
//
5
5
// This copy of Ice is licensed to you under the terms described in the
6
6
// ICE_LICENSE file included in this distribution.
12
12
#include <Ice/Service.h>
13
13
#include <IceGrid/RegistryI.h>
14
14
#include <IceGrid/TraceLevels.h>
15
 
#ifdef __BCPLUSPLUS__
16
 
#  include <IceGrid/AdminSessionI.h>
17
 
#  include <IceGrid/ReapThread.h>
18
 
#  include <IceGrid/Database.h>
19
 
#  include <IceGrid/WellKnownObjectsManager.h>
20
 
#endif
 
15
#include <IceGrid/Util.h>
21
16
 
22
17
using namespace std;
23
18
using namespace Ice;
31
26
public:
32
27
 
33
28
    RegistryService();
 
29
    ~RegistryService();
34
30
 
35
31
    virtual bool shutdown();
36
32
 
37
33
protected:
38
34
 
39
 
    virtual bool start(int, char*[]);
 
35
    virtual bool start(int, char*[], int&);
40
36
    virtual void waitForShutdown();
41
37
    virtual bool stop();
42
38
    virtual CommunicatorPtr initializeCommunicator(int&, char*[], const InitializationData&);
54
50
{
55
51
}
56
52
 
 
53
RegistryService::~RegistryService()
 
54
{
 
55
}
 
56
 
57
57
bool
58
58
RegistryService::shutdown()
59
59
{
63
63
}
64
64
 
65
65
bool
66
 
RegistryService::start(int argc, char* argv[])
 
66
RegistryService::start(int argc, char* argv[], int& status)
67
67
{
68
68
    bool nowarn;
69
69
    bool readonly;
77
77
    vector<string> args;
78
78
    try
79
79
    {
80
 
#if defined(__BCPLUSPLUS__) && (__BCPLUSPLUS__ >= 0x0600)
81
 
        IceUtil::DummyBCC dummy;
82
 
#endif
83
80
        args = opts.parse(argc, (const char**)argv);
84
81
    }
85
82
    catch(const IceUtilInternal::BadOptException& e)
92
89
    if(opts.isSet("help"))
93
90
    {
94
91
        usage(argv[0]);
 
92
        status = EXIT_SUCCESS;
95
93
        return false;
96
94
    }
97
95
    if(opts.isSet("version"))
98
96
    {
99
97
        print(ICE_STRING_VERSION);
 
98
        status = EXIT_SUCCESS;
100
99
        return false;
101
100
    }
102
101
    nowarn = opts.isSet("nowarn");
121
120
        out << "you should set individual adapter thread pools instead.";
122
121
    }
123
122
 
 
123
 
124
124
    TraceLevelsPtr traceLevels = new TraceLevels(communicator(), "IceGrid.Registry");
125
125
    
126
126
    _registry = new RegistryI(communicator(), traceLevels, nowarn, readonly);
163
163
    //
164
164
    initData.properties->setProperty("Ice.Default.CollocationOptimized", "0");
165
165
 
 
166
    //
 
167
    // Default backend database plugin is Freeze if none is specified.
 
168
    //
 
169
    if(initData.properties->getProperty("Ice.Plugin.DB").empty())
 
170
    {
 
171
        initData.properties->setProperty("Ice.Plugin.DB", "IceGridFreezeDB:createFreezeDB");
 
172
    }
 
173
 
 
174
    //
 
175
    // Setup the client thread pool size.
 
176
    //
 
177
    setupThreadPool(initData.properties, "Ice.ThreadPool.Client", 1, 100);
 
178
 
166
179
    return Service::initializeCommunicator(argc, argv, initData);
167
180
}
168
181
 
188
201
    print("Usage: " + appName + " [options]\n" + options);
189
202
}
190
203
 
 
204
//COMPILERFIX: Borland C++ 2010 doesn't support wmain for console applications.
 
205
#if defined(_WIN32 ) && !defined(__BCPLUSPLUS__)
 
206
 
 
207
int
 
208
wmain(int argc, wchar_t* argv[])
 
209
 
 
210
#else
 
211
 
191
212
int
192
213
main(int argc, char* argv[])
 
214
 
 
215
#endif
193
216
{
194
217
    RegistryService svc;
195
218
    return svc.main(argc, argv);