blob: b09862fdd615ce2818f912ffd7ab84fb6fc8af46 (
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
|
// **********************************************************************
//
// Copyright (c) 2002
// MutableRealms, Inc.
// Huntsville, AL, USA
//
// All Rights Reserved
//
// **********************************************************************
#ifndef ICE_CONNECTION_FACTORY_H
#define ICE_CONNECTION_FACTORY_H
#include <IceUtil/RecMutex.h>
#include <Ice/ConnectionFactoryF.h>
#include <Ice/ConnectionF.h>
#include <Ice/InstanceF.h>
#include <Ice/ObjectAdapterF.h>
#include <Ice/EndpointF.h>
#include <Ice/AcceptorF.h>
#include <Ice/TransceiverF.h>
#include <Ice/RouterF.h>
#include <Ice/EventHandler.h>
#include <list>
namespace Ice
{
class LocalException;
class ObjectAdapterI;
}
namespace IceInternal
{
class OutgoingConnectionFactory : public ::IceUtil::Shared, public ::IceUtil::Mutex
{
public:
ConnectionPtr create(const std::vector<EndpointPtr>&);
void setRouter(const ::Ice::RouterPrx&);
void removeAdapter(const ::Ice::ObjectAdapterPtr&);
private:
OutgoingConnectionFactory(const InstancePtr&);
virtual ~OutgoingConnectionFactory();
void destroy();
friend class Instance;
InstancePtr _instance;
std::map<EndpointPtr, ConnectionPtr> _connections;
};
class IncomingConnectionFactory : public EventHandler, public ::IceUtil::Monitor< ::IceUtil::Mutex>
{
public:
void hold();
void activate();
EndpointPtr endpoint() const;
bool equivalent(const EndpointPtr&) const;
std::list<ConnectionPtr> connections() const;
//
// Operations from EventHandler
//
virtual bool readable() const;
virtual void read(BasicStream&);
virtual void message(BasicStream&, const ThreadPoolPtr&);
virtual void finished(const ThreadPoolPtr&);
virtual void exception(const ::Ice::LocalException&);
private:
IncomingConnectionFactory(const InstancePtr&, const EndpointPtr&, const ::Ice::ObjectAdapterPtr&);
virtual ~IncomingConnectionFactory();
void destroy();
void waitUntilFinished();
friend class ::Ice::ObjectAdapterI;
enum State
{
StateActive,
StateHolding,
StateClosed
};
void setState(State);
void registerWithPool();
void unregisterWithPool();
EndpointPtr _endpoint;
::Ice::ObjectAdapterPtr _adapter;
AcceptorPtr _acceptor;
TransceiverPtr _transceiver;
ThreadPoolPtr _serverThreadPool;
std::list<ConnectionPtr> _connections;
State _state;
bool _warn;
bool _registeredWithPool;
};
}
#endif
|