diff options
author | Benoit Foucher <benoit@zeroc.com> | 2012-10-12 11:34:53 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2012-10-12 11:34:53 +0200 |
commit | 23c1e3b603a9d902593ffe9f99562fcda3af1589 (patch) | |
tree | 60ea7cdc0da5a9676ca12350ac82b069cc86eb5e /java/src/IceMX/InvocationObserverI.java | |
parent | .NET demo project updates (diff) | |
download | ice-23c1e3b603a9d902593ffe9f99562fcda3af1589.tar.bz2 ice-23c1e3b603a9d902593ffe9f99562fcda3af1589.tar.xz ice-23c1e3b603a9d902593ffe9f99562fcda3af1589.zip |
Added support for Glacier2 MX and fixed ICE-4880
Diffstat (limited to 'java/src/IceMX/InvocationObserverI.java')
-rw-r--r-- | java/src/IceMX/InvocationObserverI.java | 144 |
1 files changed, 0 insertions, 144 deletions
diff --git a/java/src/IceMX/InvocationObserverI.java b/java/src/IceMX/InvocationObserverI.java deleted file mode 100644 index 8c2d6cf1d32..00000000000 --- a/java/src/IceMX/InvocationObserverI.java +++ /dev/null @@ -1,144 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2012 ZeroC, Inc. All rights reserved. -// -// This copy of Ice is licensed to you under the terms described in the -// ICE_LICENSE file included in this distribution. -// -// ********************************************************************** - -package IceMX; - -public class InvocationObserverI extends Observer<InvocationMetrics> implements Ice.Instrumentation.InvocationObserver -{ - static private final class RemoteInvocationHelper extends MetricsHelper<Metrics> - { - static private final AttributeResolver _attributes = new AttributeResolver() - { - { - try - { - Class<?> cl = RemoteInvocationHelper.class; - add("parent", cl.getDeclaredMethod("getParent")); - add("id", cl.getDeclaredMethod("getId")); - add("endpoint", cl.getDeclaredMethod("getEndpoint")); - CommunicatorObserverI.addConnectionAttributes(this, RemoteInvocationHelper.class); - } - catch(Exception ex) - { - ex.printStackTrace(); - assert(false); - } - } - }; - - RemoteInvocationHelper(Ice.ConnectionInfo con, Ice.Endpoint endpt) - { - super(_attributes); - _connectionInfo = con; - _endpoint = endpt; - } - - String - getId() - { - if(_id == null) - { - _id = _endpoint.toString(); - if(_connectionInfo.connectionId != null && !_connectionInfo.connectionId.isEmpty()) - { - _id += " [" + _connectionInfo.connectionId + "]"; - } - } - return _id; - } - - String - getParent() - { - if(_connectionInfo.adapterName != null && !_connectionInfo.adapterName.isEmpty()) - { - return _connectionInfo.adapterName; - } - else - { - return "Communicator"; - } - } - - Ice.ConnectionInfo - getConnectionInfo() - { - return _connectionInfo; - } - - Ice.Endpoint - getEndpoint() - { - return _endpoint; - } - - Ice.EndpointInfo - getEndpointInfo() - { - if(_endpointInfo == null) - { - _endpointInfo = _endpoint.getInfo(); - } - return _endpointInfo; - } - - String - getEndpointEncodingVersion() - { - return Ice.Util.encodingVersionToString(getEndpointInfo().encoding); - } - - String - getEndpointProtocolVersion() - { - return Ice.Util.protocolVersionToString(getEndpointInfo().protocol); - } - - final private Ice.ConnectionInfo _connectionInfo; - final private Ice.Endpoint _endpoint; - private String _id; - private Ice.EndpointInfo _endpointInfo; - }; - - public void - userException() - { - forEach(_userException); - } - - public void - retried() - { - forEach(_incrementRetry); - } - - public Observer - getRemoteObserver(Ice.ConnectionInfo con, Ice.Endpoint endpt) - { - return getObserver("Remote", new RemoteInvocationHelper(con, endpt), Metrics.class, ObserverI.class); - } - - final MetricsUpdate<InvocationMetrics> _incrementRetry = new MetricsUpdate<InvocationMetrics>() - { - public void - update(InvocationMetrics v) - { - ++v.retry; - } - }; - - final MetricsUpdate<InvocationMetrics> _userException = new MetricsUpdate<InvocationMetrics>() - { - public void - update(InvocationMetrics v) - { - ++v.userException; - } - }; -}
\ No newline at end of file |