// ********************************************************************** // // Copyright (c) 2003-2013 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 ObserverWithDelegate extends Observer { public void attach() { super.attach(); if(_delegate != null) { _delegate.attach(); } } public void detach() { super.detach(); if(_delegate != null) { _delegate.detach(); } } public void failed(String exceptionName) { super.failed(exceptionName); if(_delegate != null) { _delegate.failed(exceptionName); } } public O getDelegate() { return _delegate; } public void setDelegate(O del) { _delegate = del; } @SuppressWarnings("unchecked") public , Obs extends Ice.Instrumentation.Observer> Obs getObserver(String mapName, MetricsHelper helper, Class mcl, Class ocl, Obs delegate) { ObserverImpl obsv = super.getObserver(mapName, helper, mcl, ocl); if(obsv != null) { obsv.setDelegate(delegate); return (Obs)obsv; } return delegate; } protected O _delegate; };