diff options
author | Matthew Newhook <matthew@zeroc.com> | 2014-10-20 11:40:05 -0230 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2014-10-20 11:40:05 -0230 |
commit | b51469b41167fb86ae2059a15cf0475c53fdda7b (patch) | |
tree | fc85d6ca2efd89c67e1e4e7438f437c3e08313f4 /java/src/IceInternal/InvocationObserverI.java | |
parent | Fixed (ICE-5695) - IceSSL: misleading exception (diff) | |
download | ice-b51469b41167fb86ae2059a15cf0475c53fdda7b.tar.bz2 ice-b51469b41167fb86ae2059a15cf0475c53fdda7b.tar.xz ice-b51469b41167fb86ae2059a15cf0475c53fdda7b.zip |
Down with ant. From the gradle to the grave.
Diffstat (limited to 'java/src/IceInternal/InvocationObserverI.java')
-rw-r--r-- | java/src/IceInternal/InvocationObserverI.java | 249 |
1 files changed, 0 insertions, 249 deletions
diff --git a/java/src/IceInternal/InvocationObserverI.java b/java/src/IceInternal/InvocationObserverI.java deleted file mode 100644 index bf96a9c0d0d..00000000000 --- a/java/src/IceInternal/InvocationObserverI.java +++ /dev/null @@ -1,249 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2014 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 IceInternal; - -import IceMX.*; - -public class InvocationObserverI - extends IceMX.ObserverWithDelegate<IceMX.InvocationMetrics, Ice.Instrumentation.InvocationObserver> - implements Ice.Instrumentation.InvocationObserver -{ - static public final class RemoteInvocationHelper extends MetricsHelper<RemoteMetrics> - { - static private final AttributeResolver _attributes = new AttributeResolver() - { - { - try - { - Class<?> cl = RemoteInvocationHelper.class; - add("parent", cl.getDeclaredMethod("getParent")); - add("id", cl.getDeclaredMethod("getId")); - add("requestId", cl.getDeclaredMethod("getRequestId")); - CommunicatorObserverI.addConnectionAttributes(this, RemoteInvocationHelper.class); - } - catch(Exception ex) - { - ex.printStackTrace(); - assert(false); - } - } - }; - - RemoteInvocationHelper(Ice.ConnectionInfo con, Ice.Endpoint endpt, int requestId, int size) - { - super(_attributes); - _connectionInfo = con; - _endpoint = endpt; - _requestId = requestId; - _size = size; - } - - @Override - public void - initMetrics(RemoteMetrics v) - { - v.size += _size; - } - - public String - getId() - { - if(_id == null) - { - _id = _endpoint.toString(); - if(_connectionInfo.connectionId != null && !_connectionInfo.connectionId.isEmpty()) - { - _id += " [" + _connectionInfo.connectionId + "]"; - } - } - return _id; - } - - int - getRequestId() - { - return _requestId; - } - - public String - getParent() - { - if(_connectionInfo.adapterName != null && !_connectionInfo.adapterName.isEmpty()) - { - return _connectionInfo.adapterName; - } - else - { - return "Communicator"; - } - } - - public Ice.ConnectionInfo - getConnectionInfo() - { - return _connectionInfo; - } - - public Ice.Endpoint - getEndpoint() - { - return _endpoint; - } - - public Ice.EndpointInfo - getEndpointInfo() - { - if(_endpointInfo == null) - { - _endpointInfo = _endpoint.getInfo(); - } - return _endpointInfo; - } - - final private Ice.ConnectionInfo _connectionInfo; - final private Ice.Endpoint _endpoint; - final private int _requestId; - final private int _size; - private String _id; - private Ice.EndpointInfo _endpointInfo; - }; - - static public final class CollocatedInvocationHelper extends MetricsHelper<CollocatedMetrics> - { - static private final AttributeResolver _attributes = new AttributeResolver() - { - { - try - { - Class<?> cl = CollocatedInvocationHelper.class; - add("parent", cl.getDeclaredMethod("getParent")); - add("id", cl.getDeclaredMethod("getId")); - add("requestId", cl.getDeclaredMethod("getRequestId")); - } - catch(Exception ex) - { - ex.printStackTrace(); - assert(false); - } - } - }; - - CollocatedInvocationHelper(Ice.ObjectAdapter adapter, int requestId, int size) - { - super(_attributes); - _id = adapter.getName(); - _requestId = requestId; - _size = size; - } - - @Override - public void - initMetrics(CollocatedMetrics v) - { - v.size += _size; - } - - public String - getId() - { - return _id; - } - - int - getRequestId() - { - return _requestId; - } - - public String - getParent() - { - return "Communicator"; - } - - final private int _requestId; - final private int _size; - final private String _id; - }; - - @Override - public void - userException() - { - forEach(_userException); - if(_delegate != null) - { - _delegate.userException(); - } - } - - @Override - public void - retried() - { - forEach(_incrementRetry); - if(_delegate != null) - { - _delegate.retried(); - } - } - - @Override - public Ice.Instrumentation.RemoteObserver - getRemoteObserver(Ice.ConnectionInfo con, Ice.Endpoint edpt, int requestId, int sz) - { - Ice.Instrumentation.RemoteObserver delegate = null; - if(_delegate != null) - { - delegate = _delegate.getRemoteObserver(con, edpt, requestId, sz); - } - return getObserver("Remote", - new RemoteInvocationHelper(con, edpt, requestId, sz), - RemoteMetrics.class, - RemoteObserverI.class, - delegate); - } - - @Override - public Ice.Instrumentation.CollocatedObserver - getCollocatedObserver(Ice.ObjectAdapter adapter, int requestId, int sz) - { - Ice.Instrumentation.CollocatedObserver delegate = null; - if(_delegate != null) - { - delegate = _delegate.getCollocatedObserver(adapter, requestId, sz); - } - return getObserver("Collocated", - new CollocatedInvocationHelper(adapter, requestId, sz), - CollocatedMetrics.class, - CollocatedObserverI.class, - delegate); - } - - final MetricsUpdate<InvocationMetrics> _incrementRetry = new MetricsUpdate<InvocationMetrics>() - { - @Override - public void - update(InvocationMetrics v) - { - ++v.retry; - } - }; - - final MetricsUpdate<InvocationMetrics> _userException = new MetricsUpdate<InvocationMetrics>() - { - @Override - public void - update(InvocationMetrics v) - { - ++v.userException; - } - }; -} |