summaryrefslogtreecommitdiff
path: root/cpp/src/IcePack/ServerManagerI.h
blob: 8e1190f4e14c9bd5c191119b7c4b0ab56f85d7c2 (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
// **********************************************************************
//
// Copyright (c) 2001
// Mutable Realms, Inc.
// Huntsville, AL, USA
//
// All Rights Reserved
//
// **********************************************************************

#ifndef ICE_PACK_SERVER_MANAGER_I_H
#define ICE_PACK_SERVER_MANAGER_I_H

#include <IceUtil/Mutex.h>
#include <IcePack/ServerManager.h>
#include <IcePack/Activator.h>
#include <set>


namespace IcePack
{

class ServerI : public Server, public ::IceUtil::Monitor< ::IceUtil::Mutex>
{
public:
    ServerI(const ::Ice::ObjectAdapterPtr&, const ActivatorPrx&);
    virtual ~ServerI();
    
    virtual ServerDescription getServerDescription(const ::Ice::Current&);
    virtual bool start(const ::Ice::Current&);
    virtual void terminationCallback(const ::Ice::Current&);
    virtual ServerState getState(const ::Ice::Current&);

    void setState(ServerState);

private:

    ::Ice::ObjectAdapterPtr _adapter;
    ActivatorPrx _activator;
};


class ServerManagerI : public ServerManager, public IceUtil::Mutex
{
public:

    ServerManagerI(const Ice::ObjectAdapterPtr&, const AdapterManagerPrx&, const ActivatorPrx&);
    virtual ~ServerManagerI();

    virtual ServerPrx create(const ServerDescription&, const ::Ice::Current&);
    virtual ServerPrx findByName(const ::std::string&, const ::Ice::Current&);
    virtual void remove(const ::std::string&, const ::Ice::Current&);
    virtual ServerNames getAll(const ::Ice::Current&);

private:

    ::Ice::ObjectAdapterPtr _adapter;
    ::std::set< ::std::string> _serverNames;
    AdapterManagerPrx _adapterManager;
    ActivatorPrx _activator;
};

}

#endif