summaryrefslogtreecommitdiff
path: root/cppe/src/IceE/ObjectAdapterFactory.h
blob: d0ebb12746d45683f146c842c819f2a0ba6dd82e (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
// **********************************************************************
//
// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved.
//
// This copy of Ice-E is licensed to you under the terms described in the
// ICEE_LICENSE file included in this distribution.
//
// **********************************************************************

#ifndef ICEE_OBJECT_ADAPTER_FACTORY_H
#define ICEE_OBJECT_ADAPTER_FACTORY_H

#include <IceE/ObjectAdapterF.h>
#ifdef ICEE_HAS_ROUTER
# include <IceE/RouterF.h>
#endif
#include <IceE/ProxyF.h>
#include <IceE/CommunicatorF.h>
#include <IceE/InstanceF.h>

#include <IceE/Shared.h>
#include <IceE/Mutex.h>
#include <IceE/Monitor.h>

namespace IceInternal
{

class ObjectAdapterFactory : public ::IceUtil::Shared, public ::IceUtil::Monitor< ::IceUtil::Mutex>
{
public:

    void shutdown();
    void waitForShutdown();
    bool isShutdown() const;
    void destroy();

    ::Ice::ObjectAdapterPtr createObjectAdapter(const std::string&, const std::string&
#ifdef ICEE_HAS_ROUTER
						, const ::Ice::RouterPrx&
#endif
    					        );
    void removeObjectAdapter(const std::string&);
    void flushBatchRequests() const;

private:

    ObjectAdapterFactory(const InstancePtr&, const ::Ice::CommunicatorPtr&);
    virtual ~ObjectAdapterFactory();
    friend class Instance;

    InstancePtr _instance;
    ::Ice::CommunicatorPtr _communicator;
    std::map<std::string, ::Ice::ObjectAdapterPtr> _adapters;
    bool _waitForShutdown;
};

}

#endif