blob: 6bc13b156fb6e6d946f3f53def85d49dc7622127 (
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
|
// **********************************************************************
//
// 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 MISSIVE_H
#define MISSIVE_H
#include <Ice/Ice.h>
#include <IceUtil/Thread.h>
#include <IceUtil/Monitor.h>
namespace Glacier
{
class Request;
typedef IceUtil::Handle<Request> RequestPtr;
class Request : virtual public IceUtil::Shared
{
public:
Request(const Ice::ObjectPrx&, const std::vector<Ice::Byte>&, const Ice::Current&, bool,
const Ice::AMI_Object_ice_invokePtr& = 0);
void invoke();
bool override(const RequestPtr&);
const Ice::ObjectPrx& getProxy() const;
const Ice::Current& getCurrent() const;
private:
Ice::ObjectPrx _proxy;
std::vector<Ice::Byte> _inParams;
Ice::Current _current;
bool _forwardContext;
Ice::AMI_Object_ice_invokePtr _amiCB;
std::string _override;
};
class RequestQueue;
typedef IceUtil::Handle<RequestQueue> RequestQueuePtr;
class RequestQueue : public IceUtil::Thread, public IceUtil::Monitor<IceUtil::Mutex>
{
public:
RequestQueue(const Ice::CommunicatorPtr&, int, bool, const IceUtil::Time&);
virtual ~RequestQueue();
void destroy();
void addMissive(const RequestPtr&);
void addRequest(const RequestPtr&);
virtual void run();
private:
Ice::CommunicatorPtr _communicator;
const Ice::LoggerPtr _logger;
const int _traceLevel;
const bool _reverse;
const IceUtil::Time _sleepTime;
std::vector<RequestPtr> _missives;
std::vector<RequestPtr> _requests;
bool _destroy;
};
}
#endif
|