blob: 892c039bb5627b94ec0ef7f0bb9067e27117f529 (
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
|
// **********************************************************************
//
// Copyright (c) 2003
// ZeroC, Inc.
// Billerica, MA, USA
//
// All Rights Reserved.
//
// Ice is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License version 2 as published by
// the Free Software Foundation.
//
// **********************************************************************
#ifndef BLOBJECT_H
#define BLOBJECT_H
#include <Ice/Ice.h>
#include <IceUtil/Monitor.h>
#include <Glacier/Request.h>
namespace Glacier
{
class TwowayThrottle : public IceUtil::Monitor<IceUtil::Mutex>
{
public:
TwowayThrottle(const Ice::CommunicatorPtr&, bool);
~TwowayThrottle();
void twowayStarted(const Ice::ObjectPrx&, const Ice::Current&);
void twowayFinished();
private:
const Ice::CommunicatorPtr _communicator;
const bool _reverse;
const Ice::PropertiesPtr _properties;
const Ice::LoggerPtr _logger;
const int _traceLevel;
const int _max;
int _count;
};
class Blobject : public Ice::BlobjectAsync
{
public:
Blobject(const Ice::CommunicatorPtr&, bool);
virtual ~Blobject();
void destroy();
void invoke(Ice::ObjectPrx&, const Ice::AMD_Object_ice_invokePtr&, const std::vector<Ice::Byte>&,
const Ice::Current&);
bool modifyProxy(Ice::ObjectPrx&, const Ice::Current&);
protected:
Ice::CommunicatorPtr _communicator;
const bool _reverse;
const Ice::PropertiesPtr _properties;
const Ice::LoggerPtr _logger;
const int _traceLevel;
private:
const bool _forwardContext;
const IceUtil::Time _sleepTime;
RequestQueuePtr _requestQueue;
IceUtil::ThreadControl _requestQueueControl;
TwowayThrottle _twowayThrottle;
};
}
#endif
|