~ubuntu-branches/ubuntu/quantal/zeroc-ice/quantal

« back to all changes in this revision

Viewing changes to cpp/src/Glacier2/RouterI.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Cleto Martin Angelina
  • Date: 2011-04-25 18:44:24 UTC
  • mfrom: (6.1.14 sid)
  • Revision ID: james.westby@ubuntu.com-20110425184424-sep9i9euu434vq4c
Tags: 3.4.1-7
* Bug fix: "libdb5.1-java.jar was renamed to db.jar", thanks to Ondřej
  Surý (Closes: #623555).
* Bug fix: "causes noise in php5", thanks to Jayen Ashar (Closes:
  #623533).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// **********************************************************************
2
2
//
3
 
// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
 
3
// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
4
4
//
5
5
// This copy of Ice is licensed to you under the terms described in the
6
6
// ICE_LICENSE file included in this distribution.
20
20
 
21
21
Glacier2::RouterI::RouterI(const InstancePtr& instance, const ConnectionPtr& connection, const string& userId, 
22
22
                           const SessionPrx& session, const Identity& controlId, const FilterManagerPtr& filters,
23
 
                           const Ice::Context& sslContext) :
 
23
                           const Ice::Context& context) :
24
24
    _instance(instance),
25
 
    _clientBlobject(new ClientBlobject(_instance, filters, sslContext)),
 
25
    _clientBlobject(new ClientBlobject(_instance, filters, context)),
26
26
    _connection(connection),
27
27
    _userId(userId),
28
28
    _session(session),
29
29
    _controlId(controlId),
30
 
    _sslContext(sslContext),
 
30
    _context(context),
31
31
    _timestamp(IceUtil::Time::now(IceUtil::Time::Monotonic))
32
32
{
33
33
    //
67
67
void
68
68
Glacier2::RouterI::destroy(const AMI_Session_destroyPtr& amiCB)
69
69
{
70
 
    _connection->close(true);
71
 
 
72
70
    if(_session)
73
71
    {
74
72
        if(_instance->serverObjectAdapter())
91
89
            }
92
90
        }
93
91
 
94
 
        if(_sslContext.size() > 0)
 
92
        if(_context.size() > 0)
95
93
        {
96
 
            _session->destroy_async(amiCB, _sslContext);
 
94
            _session->destroy_async(amiCB, _context);
97
95
        }
98
96
        else
99
97
        {
127
125
ObjectProxySeq
128
126
Glacier2::RouterI::addProxies(const ObjectProxySeq& proxies, const Current& current)
129
127
{
130
 
    IceUtil::Mutex::Lock lock(*this);
131
 
 
132
 
    _timestamp = IceUtil::Time::now(IceUtil::Time::Monotonic);
133
 
 
 
128
    updateTimestamp();
134
129
    return _clientBlobject->add(proxies, current);
135
130
}
136
131
 
156
151
}
157
152
 
158
153
void
 
154
Glacier2::RouterI::refreshSession(const Current&)
 
155
{
 
156
    assert(false); // Must not be called in this router implementation.
 
157
}
 
158
 
 
159
void
159
160
Glacier2::RouterI::destroySession(const Current&)
160
161
{
161
162
    assert(false); // Must not be called in this router implementation.
171
172
ClientBlobjectPtr
172
173
Glacier2::RouterI::getClientBlobject() const
173
174
{
174
 
    IceUtil::Mutex::Lock lock(*this);
175
 
 
176
 
    _timestamp = IceUtil::Time::now(IceUtil::Time::Monotonic);
177
 
 
 
175
    updateTimestamp();
178
176
    return _clientBlobject;
179
177
}
180
178
 
198
196
IceUtil::Time
199
197
Glacier2::RouterI::getTimestamp() const
200
198
{
201
 
    IceUtil::Mutex::TryLock lock(*this);
202
 
 
 
199
    IceUtil::Mutex::TryLock lock(_timestampMutex);
203
200
    if(lock.acquired())
204
201
    {
205
202
        return _timestamp;
210
207
    }
211
208
}
212
209
 
 
210
void
 
211
Glacier2::RouterI::updateTimestamp() const
 
212
{
 
213
    IceUtil::Mutex::Lock lock(_timestampMutex);
 
214
    _timestamp = IceUtil::Time::now(IceUtil::Time::Monotonic);
 
215
}
 
216
 
213
217
string
214
218
Glacier2::RouterI::toString() const
215
219
{