summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/Instance.h
blob: d604d2845abcd33702975e0ed060e14c7189e2cb (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
// **********************************************************************
//
// Copyright (c) 2002
// MutableRealms, Inc.
// Huntsville, AL, USA
//
// All Rights Reserved
//
// **********************************************************************

#ifndef ICE_INSTANCE_H
#define ICE_INSTANCE_H

#include <IceUtil/Shared.h>
#include <Ice/InstanceF.h>
#include <Ice/CommunicatorF.h>
#include <Ice/PropertiesF.h>
#include <Ice/LoggerF.h>
#include <Ice/TraceLevelsF.h>
#include <Ice/ProxyFactoryF.h>
#include <Ice/ThreadPoolF.h>
#include <Ice/EmitterF.h>
#include <Ice/ValueFactoryManagerF.h>
#include <Ice/ObjectAdapterFactoryF.h>
#include <Ice/PicklerF.h>

namespace Ice
{

class CommunicatorI;

}

namespace IceInternal
{

class Instance : public ::IceUtil::Shared, public JTCMutex
{
public:

    ::Ice::CommunicatorPtr communicator();
    ::Ice::PropertiesPtr properties();
    ::Ice::LoggerPtr logger();
    void logger(const ::Ice::LoggerPtr&);
    TraceLevelsPtr traceLevels();
    ProxyFactoryPtr proxyFactory();
    ThreadPoolPtr threadPool();
    EmitterFactoryPtr emitterFactory();
    ValueFactoryManagerPtr valueFactoryManager();
    ObjectAdapterFactoryPtr objectAdapterFactory();
    ::Ice::PicklerPtr pickler();
    
private:

    Instance(const ::Ice::CommunicatorPtr&, const ::Ice::PropertiesPtr&);
    virtual ~Instance();
    void destroy();
    friend class ::Ice::CommunicatorI;

    ::Ice::CommunicatorPtr _communicator;
    ::Ice::PropertiesPtr _properties;
    ::Ice::LoggerPtr _logger;
    TraceLevelsPtr _traceLevels;
    ProxyFactoryPtr _proxyFactory;
    ThreadPoolPtr _threadPool;
    EmitterFactoryPtr _emitterFactory;
    ValueFactoryManagerPtr _valueFactoryManager;
    ObjectAdapterFactoryPtr _objectAdapterFactory;
    ::Ice::PicklerPtr _pickler;

    //
    // Global state management
    //
    friend class GlobalStateMutexDestroyer;
    static JTCMutex* _globalStateMutex;
    static JTCInitialize* _globalStateJTC;
#ifndef WIN32
    static std::string _identForOpenlog;
#endif
    static int _globalStateCounter;
};

}

#endif