diff options
author | Matthew Newhook <matthew@zeroc.com> | 2014-08-07 14:05:44 -0230 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2014-08-07 14:05:44 -0230 |
commit | e3a672a438635a1173388aea9d7a2d44de358945 (patch) | |
tree | 57113ece1dd013c9687468a8dd7cc62c80136b86 /java/src | |
parent | ICE-5457 added ability to set source address for connections (diff) | |
download | ice-e3a672a438635a1173388aea9d7a2d44de358945.tar.bz2 ice-e3a672a438635a1173388aea9d7a2d44de358945.tar.xz ice-e3a672a438635a1173388aea9d7a2d44de358945.zip |
Add @Override where possible, and remove trailing white space.
Diffstat (limited to 'java/src')
154 files changed, 1697 insertions, 770 deletions
diff --git a/java/src/Ice/AMI_Object_ice_flushBatchRequests.java b/java/src/Ice/AMI_Object_ice_flushBatchRequests.java index 1af33dc034a..63b45990b02 100644 --- a/java/src/Ice/AMI_Object_ice_flushBatchRequests.java +++ b/java/src/Ice/AMI_Object_ice_flushBatchRequests.java @@ -24,6 +24,7 @@ public abstract class AMI_Object_ice_flushBatchRequests extends Callback_Object_ **/ public abstract void ice_exception(LocalException ex); + @Override public final void exception(LocalException ex) { ice_exception(ex); diff --git a/java/src/Ice/AMI_Object_ice_invoke.java b/java/src/Ice/AMI_Object_ice_invoke.java index 328974db25d..e3bd277d1f4 100644 --- a/java/src/Ice/AMI_Object_ice_invoke.java +++ b/java/src/Ice/AMI_Object_ice_invoke.java @@ -32,11 +32,13 @@ public abstract class AMI_Object_ice_invoke extends Callback_Object_ice_invoke **/ public abstract void ice_exception(LocalException ex); + @Override public final void response(boolean ok, byte[] outEncaps) { ice_response(ok, outEncaps); } + @Override public final void exception(LocalException ex) { ice_exception(ex); diff --git a/java/src/Ice/Application.java b/java/src/Ice/Application.java index bf6543ce380..3c649f72301 100644 --- a/java/src/Ice/Application.java +++ b/java/src/Ice/Application.java @@ -155,7 +155,7 @@ public abstract class Application // // We parse the properties here to extract Ice.ProgramName. - // + // InitializationData initData; if(initializationData != null) { @@ -376,7 +376,7 @@ public abstract class Application "interrupt method called on Application configured to not handle interrupts."); } } - + /** * Instructs <code>Application</code> to call {@link Communicator#shutdown} on receipt of a signal. * @@ -445,7 +445,7 @@ public abstract class Application "interrupt method called on Application configured to not handle interrupts."); } } - + /** * Clears any shutdown hooks, including any hook established with {@link #destroyOnInterrupt}code> or * {@link #shutdownOnInterrupt}. @@ -563,6 +563,7 @@ public abstract class Application static class DestroyHook extends AppHook { + @Override public void run() { @@ -597,6 +598,7 @@ public abstract class Application static class ShutdownHook extends AppHook { + @Override public void run() { @@ -640,6 +642,7 @@ public abstract class Application _hook = hook; } + @Override public void run() { @@ -649,7 +652,7 @@ public abstract class Application { return; } - + _hook.run(); clearCallbackInProgress(); diff --git a/java/src/Ice/AsyncCallback.java b/java/src/Ice/AsyncCallback.java index 41467385a2e..ca458930d2f 100644 --- a/java/src/Ice/AsyncCallback.java +++ b/java/src/Ice/AsyncCallback.java @@ -16,6 +16,7 @@ package Ice; * * @deprecated This class is deprecated, use Ice.Callback instead. **/ +@Deprecated public abstract class AsyncCallback extends Callback { } diff --git a/java/src/Ice/AsyncResult.java b/java/src/Ice/AsyncResult.java index d5fb267fbfe..2cce84b373e 100644 --- a/java/src/Ice/AsyncResult.java +++ b/java/src/Ice/AsyncResult.java @@ -182,13 +182,13 @@ public class AsyncResult return _is; } - public void + public void __endReadParams() { _is.endReadEncaps(); } - public void + public void __readEmptyParams() { _is.skipEmptyEncaps(null); @@ -254,6 +254,7 @@ public class AsyncResult { _instance.clientThreadPool().dispatch(new IceInternal.DispatchWorkItem(_cachedConnection) { + @Override public void run() { @@ -276,7 +277,7 @@ public class AsyncResult _exception = ex; _monitor.notifyAll(); } - + __invokeCompleted(); } @@ -329,7 +330,7 @@ public class AsyncResult } } - public void + public void __attachRemoteObserver(Ice.ConnectionInfo info, Ice.Endpoint endpt, int requestId, int size) { if(_observer != null) @@ -347,7 +348,7 @@ public class AsyncResult if(_observer != null) { _childObserver = _observer.getCollocatedObserver(adapter, - requestId, + requestId, _os.size() - IceInternal.Protocol.headerSize - 4); if(_childObserver != null) { @@ -367,6 +368,7 @@ public class AsyncResult { _instance.clientThreadPool().dispatch(new IceInternal.DispatchWorkItem(_cachedConnection) { + @Override public void run() { @@ -471,16 +473,16 @@ public class AsyncResult } } - protected void + protected void __runTimerTask() { IceInternal.RequestHandler handler; synchronized(_monitor) { - handler = _timeoutRequestHandler; + handler = _timeoutRequestHandler; _timeoutRequestHandler = null; } - + if(handler != null) { handler.asyncRequestTimedOut((IceInternal.OutgoingAsyncMessageCallback)this); @@ -525,6 +527,6 @@ public class AsyncResult protected Ice.Instrumentation.InvocationObserver _observer; protected Ice.Instrumentation.ChildInvocationObserver _childObserver; - + private IceInternal.CallbackBase _callback; } diff --git a/java/src/Ice/Blobject.java b/java/src/Ice/Blobject.java index 4eccc2de288..2861ac1116f 100644 --- a/java/src/Ice/Blobject.java +++ b/java/src/Ice/Blobject.java @@ -32,6 +32,7 @@ public abstract class Blobject extends Ice.ObjectImpl public abstract boolean ice_invoke(byte[] inEncaps, ByteSeqHolder outEncaps, Current current); + @Override public DispatchStatus __dispatch(IceInternal.Incoming in, Current current) { diff --git a/java/src/Ice/BlobjectAsync.java b/java/src/Ice/BlobjectAsync.java index b1e07fc8879..e52ff6d7070 100644 --- a/java/src/Ice/BlobjectAsync.java +++ b/java/src/Ice/BlobjectAsync.java @@ -31,6 +31,7 @@ public abstract class BlobjectAsync extends Ice.ObjectImpl public abstract void ice_invoke_async(AMD_Object_ice_invoke cb, byte[] inEncaps, Current current); + @Override public DispatchStatus __dispatch(IceInternal.Incoming in, Current current) { diff --git a/java/src/Ice/Callback.java b/java/src/Ice/Callback.java index a05ac478025..f0e8eb86c7d 100644 --- a/java/src/Ice/Callback.java +++ b/java/src/Ice/Callback.java @@ -37,11 +37,13 @@ public abstract class Callback extends IceInternal.CallbackBase { } + @Override public final void __completed(AsyncResult r) { completed(r); } + @Override public final void __sent(AsyncResult r) { sent(r); diff --git a/java/src/Ice/Callback_Object_ice_id.java b/java/src/Ice/Callback_Object_ice_id.java index 1865cd08934..9ecfe651133 100644 --- a/java/src/Ice/Callback_Object_ice_id.java +++ b/java/src/Ice/Callback_Object_ice_id.java @@ -12,7 +12,7 @@ package Ice; /** * Callback object for {@link ObjectPrx#.begin_ice_id}. **/ -public abstract class Callback_Object_ice_id extends IceInternal.TwowayCallback +public abstract class Callback_Object_ice_id extends IceInternal.TwowayCallback implements Ice.TwowayCallbackArg1<String> { /** @@ -20,8 +20,10 @@ public abstract class Callback_Object_ice_id extends IceInternal.TwowayCallback * * @param __ret The Slice type id of the most-derived interface supported by the target object. **/ + @Override public abstract void response(String __ret); + @Override public final void __completed(AsyncResult __result) { ObjectPrxHelperBase.__ice_id_completed(this, __result); diff --git a/java/src/Ice/Callback_Object_ice_ids.java b/java/src/Ice/Callback_Object_ice_ids.java index efb57f86865..cfe7adbf87a 100644 --- a/java/src/Ice/Callback_Object_ice_ids.java +++ b/java/src/Ice/Callback_Object_ice_ids.java @@ -20,8 +20,10 @@ public abstract class Callback_Object_ice_ids extends IceInternal.TwowayCallback * * @param __ret The Slice type ids of the interfaces supported by the target object. **/ + @Override public abstract void response(String[] __ret); + @Override public final void __completed(AsyncResult __result) { ObjectPrxHelperBase.__ice_ids_completed(this, __result); diff --git a/java/src/Ice/Callback_Object_ice_invoke.java b/java/src/Ice/Callback_Object_ice_invoke.java index 49952389fd3..5d43c563117 100644 --- a/java/src/Ice/Callback_Object_ice_invoke.java +++ b/java/src/Ice/Callback_Object_ice_invoke.java @@ -25,8 +25,10 @@ public abstract class Callback_Object_ice_invoke * is <code>true</code>; otherwise, if <code>ok</code> is <code>false</code>, contains the * encoded user exception raised by the operation. **/ + @Override public abstract void response(boolean ret, byte[] outParams); + @Override public final void __completed(AsyncResult __result) { ObjectPrxHelperBase.__ice_invoke_completed(this, __result); diff --git a/java/src/Ice/Callback_Object_ice_isA.java b/java/src/Ice/Callback_Object_ice_isA.java index 77be0888112..ede633b21db 100644 --- a/java/src/Ice/Callback_Object_ice_isA.java +++ b/java/src/Ice/Callback_Object_ice_isA.java @@ -19,8 +19,10 @@ public abstract class Callback_Object_ice_isA extends IceInternal.TwowayCallback * * @param __ret True if the target object supports the given interface, false otherwise. **/ + @Override public abstract void response(boolean __ret); + @Override public final void __completed(AsyncResult __result) { ObjectPrxHelperBase.__ice_isA_completed(this, __result); diff --git a/java/src/Ice/CommunicatorI.java b/java/src/Ice/CommunicatorI.java index 918f5bdffaf..757fc85daf5 100644 --- a/java/src/Ice/CommunicatorI.java +++ b/java/src/Ice/CommunicatorI.java @@ -11,72 +11,84 @@ package Ice; public final class CommunicatorI implements Communicator { + @Override public void destroy() { _instance.destroy(); } + @Override public void shutdown() { _instance.objectAdapterFactory().shutdown(); } + @Override public void waitForShutdown() { _instance.objectAdapterFactory().waitForShutdown(); } + @Override public boolean isShutdown() { return _instance.objectAdapterFactory().isShutdown(); } + @Override public Ice.ObjectPrx stringToProxy(String s) { return _instance.proxyFactory().stringToProxy(s); } + @Override public String proxyToString(Ice.ObjectPrx proxy) { return _instance.proxyFactory().proxyToString(proxy); } + @Override public Ice.ObjectPrx propertyToProxy(String s) { return _instance.proxyFactory().propertyToProxy(s); } + @Override public java.util.Map<String, String> proxyToProperty(Ice.ObjectPrx proxy, String prefix) { return _instance.proxyFactory().proxyToProperty(proxy, prefix); } + @Override public Ice.Identity stringToIdentity(String s) { return _instance.stringToIdentity(s); } + @Override public String identityToString(Ice.Identity ident) { return _instance.identityToString(ident); } + @Override public ObjectAdapter createObjectAdapter(String name) { return _instance.objectAdapterFactory().createObjectAdapter(name, null); } + @Override public ObjectAdapter createObjectAdapterWithEndpoints(String name, String endpoints) { @@ -84,11 +96,12 @@ public final class CommunicatorI implements Communicator { name = java.util.UUID.randomUUID().toString(); } - + getProperties().setProperty(name + ".Endpoints", endpoints); return _instance.objectAdapterFactory().createObjectAdapter(name, null); } + @Override public ObjectAdapter createObjectAdapterWithRouter(String name, RouterPrx router) { @@ -109,72 +122,84 @@ public final class CommunicatorI implements Communicator return _instance.objectAdapterFactory().createObjectAdapter(name, router); } + @Override public void addObjectFactory(ObjectFactory factory, String id) { _instance.servantFactoryManager().add(factory, id); } + @Override public ObjectFactory findObjectFactory(String id) { return _instance.servantFactoryManager().find(id); } + @Override public Properties getProperties() { return _instance.initializationData().properties; } + @Override public Logger getLogger() { return _instance.initializationData().logger; } - public Ice.Instrumentation.CommunicatorObserver + @Override + public Ice.Instrumentation.CommunicatorObserver getObserver() { return _instance.getObserver(); } + @Override public RouterPrx getDefaultRouter() { return _instance.referenceFactory().getDefaultRouter(); } + @Override public void setDefaultRouter(RouterPrx router) { _instance.setDefaultRouter(router); } + @Override public LocatorPrx getDefaultLocator() { return _instance.referenceFactory().getDefaultLocator(); } + @Override public void setDefaultLocator(LocatorPrx locator) { _instance.setDefaultLocator(locator); } + @Override public ImplicitContext getImplicitContext() { return _instance.getImplicitContext(); } + @Override public PluginManager getPluginManager() { return _instance.pluginManager(); } + @Override public void flushBatchRequests() { @@ -182,24 +207,28 @@ public final class CommunicatorI implements Communicator end_flushBatchRequests(r); } + @Override public AsyncResult begin_flushBatchRequests() { return begin_flushBatchRequestsInternal(null); } + @Override public AsyncResult begin_flushBatchRequests(Callback cb) { return begin_flushBatchRequestsInternal(cb); } + @Override public AsyncResult begin_flushBatchRequests(Callback_Communicator_flushBatchRequests cb) { return begin_flushBatchRequestsInternal(cb); } - + + @Override public AsyncResult begin_flushBatchRequests(IceInternal.Functional_VoidCallback __responseCb, IceInternal.Functional_GenericCallback1<Ice.Exception> __exceptionCb, @@ -208,6 +237,7 @@ public final class CommunicatorI implements Communicator return begin_flushBatchRequestsInternal( new IceInternal.Functional_CallbackBase(false, __exceptionCb, __sentCb) { + @Override public final void __completed(AsyncResult __result) { try @@ -249,6 +279,7 @@ public final class CommunicatorI implements Communicator return result; } + @Override public void end_flushBatchRequests(AsyncResult r) { @@ -256,24 +287,28 @@ public final class CommunicatorI implements Communicator r.__wait(); } + @Override public ObjectPrx getAdmin() { return _instance.getAdmin(); } + @Override public void addAdminFacet(Object servant, String facet) { _instance.addAdminFacet(servant, facet); } + @Override public Object removeAdminFacet(String facet) { return _instance.removeAdminFacet(facet); } + @Override public Object findAdminFacet(String facet) { diff --git a/java/src/Ice/ConnectionI.java b/java/src/Ice/ConnectionI.java index 2fab877b62e..8d90a391253 100644 --- a/java/src/Ice/ConnectionI.java +++ b/java/src/Ice/ConnectionI.java @@ -9,8 +9,6 @@ package Ice; -import Ice.Instrumentation.InvocationObserver; - public final class ConnectionI extends IceInternal.EventHandler implements Connection, IceInternal.ResponseHandler { public interface StartCallback @@ -21,6 +19,7 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne private class TimeoutCallback implements Runnable { + @Override public void run() { @@ -147,6 +146,7 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne } } + @Override synchronized public void close(boolean force) { @@ -285,8 +285,8 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne { // // If writing or reading, nothing to do, the connection - // timeout will kick-in if writes or reads don't progress. - // This check is necessary because the actitivy timer is + // timeout will kick-in if writes or reads don't progress. + // This check is necessary because the actitivy timer is // only set when a message is fully read/written. // return; @@ -314,10 +314,10 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne heartbeat(); } } - + if(acm.close != ACMClose.CloseOff && now >= (_acmLastActivity + acm.timeout)) { - if(acm.close == ACMClose.CloseOnIdleForceful || + if(acm.close == ACMClose.CloseOnIdleForceful || (acm.close != ACMClose.CloseOnIdle && (!_requests.isEmpty() || !_asyncRequests.isEmpty()))) { // @@ -326,7 +326,7 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne // setState(StateClosed, new ConnectionTimeoutException()); } - else if(acm.close != ACMClose.CloseOnInvocation && + else if(acm.close != ACMClose.CloseOnInvocation && _dispatchCount == 0 && _batchStream.isEmpty() && _requests.isEmpty() && _asyncRequests.isEmpty()) { // @@ -687,6 +687,7 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne notifyAll(); } + @Override public void flushBatchRequests() { @@ -696,24 +697,28 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne private static final String __flushBatchRequests_name = "flushBatchRequests"; + @Override public Ice.AsyncResult begin_flushBatchRequests() { return begin_flushBatchRequestsInternal(null); } + @Override public Ice.AsyncResult begin_flushBatchRequests(Callback cb) { return begin_flushBatchRequestsInternal(cb); } + @Override public Ice.AsyncResult begin_flushBatchRequests(Callback_Connection_flushBatchRequests cb) { return begin_flushBatchRequestsInternal(cb); } + @Override public AsyncResult begin_flushBatchRequests(IceInternal.Functional_VoidCallback __responseCb, IceInternal.Functional_GenericCallback1<Ice.Exception> __exceptionCb, @@ -722,6 +727,7 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne return begin_flushBatchRequestsInternal( new IceInternal.Functional_CallbackBase(false, __exceptionCb, __sentCb) { + @Override public final void __completed(AsyncResult __result) { try @@ -752,6 +758,7 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne return result; } + @Override public void end_flushBatchRequests(AsyncResult r) { @@ -889,7 +896,8 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne return status; } - synchronized public void + @Override + synchronized public void setCallback(ConnectionCallback callback) { if(_state > StateClosing) @@ -899,6 +907,7 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne _callback = callback; } + @Override synchronized public void setACM(Ice.IntOptional timeout, Ice.Optional<ACMClose> close, Ice.Optional<ACMHeartbeat> heartbeat) { @@ -925,13 +934,14 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne } } + @Override synchronized public Ice.ACM getACM() { return _monitor != null ? _monitor.getACM() : new ACM(0, ACMClose.CloseOff, ACMHeartbeat.HeartbeatOff); } - synchronized public void + synchronized public void requestTimedOut(IceInternal.OutgoingMessageCallback out) { java.util.Iterator<OutgoingMessage> it = _sendStreams.iterator(); @@ -944,9 +954,9 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne { _requests.remove(o.requestId); } - + // - // If the request is being sent, don't remove it from the send streams, + // If the request is being sent, don't remove it from the send streams, // it will be removed once the sending is finished. // o.timedOut(); @@ -975,7 +985,7 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne } } - public void + public void asyncRequestTimedOut(IceInternal.OutgoingAsyncMessageCallback outAsync) { java.util.Iterator<OutgoingMessage> it = _sendStreams.iterator(); @@ -988,13 +998,13 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne { _asyncRequests.remove(o.requestId); } - + // - // If the request is being sent, don't remove it from the send streams, + // If the request is being sent, don't remove it from the send streams, // it will be removed once the sending is finished. // o.timedOut(); - if(o != _sendStreams.getFirst()) + if(o != _sendStreams.getFirst()) { it.remove(); } @@ -1020,6 +1030,7 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne } + @Override synchronized public void sendResponse(int requestId, IceInternal.BasicStream os, byte compressFlag) { @@ -1055,6 +1066,7 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne } } + @Override synchronized public void sendNoResponse() { @@ -1087,12 +1099,13 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne } } - public boolean + @Override + public boolean systemException(int requestId, Ice.SystemException ex) { return false; // System exceptions aren't marshalled. } - + public IceInternal.EndpointI endpoint() { @@ -1105,6 +1118,7 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne return _connector; // No mutex protection necessary, _connector is immutable. } + @Override public synchronized void setAdapter(ObjectAdapter adapter) { @@ -1135,18 +1149,21 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne // } + @Override public synchronized ObjectAdapter getAdapter() { return _adapter; } + @Override public Endpoint getEndpoint() { return _endpoint; // No mutex protection necessary, _endpoint is immutable. } + @Override public ObjectPrx createProxy(Identity ident) { @@ -1160,6 +1177,7 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne // // Operations from EventHandler // + @Override public void message(IceInternal.ThreadPoolCurrent current) { @@ -1438,6 +1456,7 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne _threadPool.dispatchFromThisThread( new IceInternal.DispatchWorkItem(this) { + @Override public void run() { @@ -1553,6 +1572,7 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne } } + @Override public void finished(IceInternal.ThreadPoolCurrent current) { @@ -1583,6 +1603,7 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne _threadPool.dispatchFromThisThread( new IceInternal.DispatchWorkItem(this) { + @Override public void run() { @@ -1670,12 +1691,14 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne } } + @Override public String toString() { return _toString(); } + @Override public java.nio.channels.SelectableChannel fd() { @@ -1699,18 +1722,21 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne } } + @Override public String type() { return _type; // No mutex lock, _type is immutable. } + @Override public int timeout() { return _endpoint.timeout(); // No mutex protection necessary, _endpoint is immutable. } + @Override public synchronized ConnectionInfo getInfo() { @@ -1721,6 +1747,7 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne return initConnectionInfo(); } + @Override public String _toString() { @@ -1733,6 +1760,7 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne setState(StateClosed, ex); } + @Override public synchronized void invokeException(int requestId, LocalException ex, int invokeNum) { @@ -1850,6 +1878,7 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne } } + @Override protected synchronized void finalize() throws Throwable @@ -2169,10 +2198,10 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne heartbeat() { assert(_state == StateActive); - + if(!_endpoint.datagram()) { - IceInternal.BasicStream os = new IceInternal.BasicStream(_instance, + IceInternal.BasicStream os = new IceInternal.BasicStream(_instance, IceInternal.Protocol.currentProtocolEncoding); os.writeBlob(IceInternal.Protocol.magic); IceInternal.Protocol.currentProtocol.__write(os); @@ -2741,7 +2770,7 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne default: { - IceInternal.TraceUtil.trace("received unknown message\n(invalid, closing connection)", info.stream, + IceInternal.TraceUtil.trace("received unknown message\n(invalid, closing connection)", info.stream, _logger, _traceLevels); throw new UnknownMessageException(); } @@ -3091,7 +3120,7 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne this.requestId = requestId; } - public void + public void timedOut() { assert((out != null || outAsync != null)); diff --git a/java/src/Ice/DispatchInterceptor.java b/java/src/Ice/DispatchInterceptor.java index 38f89f2ec3b..276a17d50b4 100644 --- a/java/src/Ice/DispatchInterceptor.java +++ b/java/src/Ice/DispatchInterceptor.java @@ -34,7 +34,8 @@ public abstract class DispatchInterceptor extends ObjectImpl **/ public abstract DispatchStatus dispatch(Request request); - + + @Override public DispatchStatus __dispatch(IceInternal.Incoming in, Current current) { diff --git a/java/src/Ice/Exception.java b/java/src/Ice/Exception.java index 00ed87da5df..f2ad7ab33c1 100644 --- a/java/src/Ice/Exception.java +++ b/java/src/Ice/Exception.java @@ -31,6 +31,7 @@ public abstract class Exception extends RuntimeException implements Cloneable * * @return The copy of this exception. **/ + @Override public java.lang.Object clone() { java.lang.Object o = null; @@ -58,6 +59,7 @@ public abstract class Exception extends RuntimeException implements Cloneable * * @return A string representation of this exception. **/ + @Override public String toString() { diff --git a/java/src/Ice/FloatOptional.java b/java/src/Ice/FloatOptional.java index 01b654ee24a..1766d4fe186 100644 --- a/java/src/Ice/FloatOptional.java +++ b/java/src/Ice/FloatOptional.java @@ -98,7 +98,7 @@ public class FloatOptional public void clear() { _isSet = false; - _value = (float)0; + _value = 0; } private float _value; diff --git a/java/src/Ice/ImplicitContextI.java b/java/src/Ice/ImplicitContextI.java index c0b86cdc30e..1ca53b9c4da 100644 --- a/java/src/Ice/ImplicitContextI.java +++ b/java/src/Ice/ImplicitContextI.java @@ -40,11 +40,13 @@ public abstract class ImplicitContextI implements ImplicitContext static class Shared extends ImplicitContextI { + @Override public synchronized java.util.Map<String, String> getContext() { return new java.util.HashMap<String, String>(_context); } + @Override public synchronized void setContext(java.util.Map<String, String> context) { _context.clear(); @@ -54,6 +56,7 @@ public abstract class ImplicitContextI implements ImplicitContext } } + @Override public synchronized boolean containsKey(String key) { if(key == null) @@ -64,6 +67,7 @@ public abstract class ImplicitContextI implements ImplicitContext return _context.containsKey(key); } + @Override public synchronized String get(String key) { if(key == null) @@ -80,6 +84,7 @@ public abstract class ImplicitContextI implements ImplicitContext return val; } + @Override public synchronized String put(String key, String value) { if(key == null) @@ -99,6 +104,7 @@ public abstract class ImplicitContextI implements ImplicitContext return oldVal; } + @Override public synchronized String remove(String key) { if(key == null) @@ -115,6 +121,7 @@ public abstract class ImplicitContextI implements ImplicitContext return val; } + @Override public void write(java.util.Map<String, String> prxContext, IceInternal.BasicStream os) { if(prxContext.isEmpty()) @@ -135,6 +142,7 @@ public abstract class ImplicitContextI implements ImplicitContext } } + @Override synchronized java.util.Map<String, String> combine(java.util.Map<String, String> prxContext) { java.util.Map<String, String> combined = new java.util.HashMap<String, String>(_context); @@ -148,6 +156,7 @@ public abstract class ImplicitContextI implements ImplicitContext static class PerThread extends ImplicitContextI { + @Override public java.util.Map<String, String> getContext() { // @@ -162,6 +171,7 @@ public abstract class ImplicitContextI implements ImplicitContext return threadContext; } + @Override public void setContext(java.util.Map<String, String> context) { if(context == null || context.isEmpty()) @@ -175,6 +185,7 @@ public abstract class ImplicitContextI implements ImplicitContext } } + @Override public boolean containsKey(String key) { if(key == null) @@ -192,6 +203,7 @@ public abstract class ImplicitContextI implements ImplicitContext return threadContext.containsKey(key); } + @Override public String get(String key) { if(key == null) @@ -213,6 +225,7 @@ public abstract class ImplicitContextI implements ImplicitContext return val; } + @Override public String put(String key, String value) { if(key == null) @@ -241,6 +254,7 @@ public abstract class ImplicitContextI implements ImplicitContext return oldVal; } + @Override public String remove(String key) { if(key == null) @@ -264,6 +278,7 @@ public abstract class ImplicitContextI implements ImplicitContext return val; } + @Override public void write(java.util.Map<String, String> prxContext, IceInternal.BasicStream os) { java.util.Map<String, String> threadContext = _map.get(Thread.currentThread()); @@ -284,6 +299,7 @@ public abstract class ImplicitContextI implements ImplicitContext } } + @Override java.util.Map<String, String> combine(java.util.Map<String, String> prxContext) { java.util.Map<String, String> threadContext = _map.get(Thread.currentThread()); diff --git a/java/src/Ice/InitializationData.java b/java/src/Ice/InitializationData.java index e7ba8110505..7dde4c0baf5 100644 --- a/java/src/Ice/InitializationData.java +++ b/java/src/Ice/InitializationData.java @@ -30,6 +30,7 @@ public final class InitializationData implements Cloneable /** * Creates and returns a copy of this object. **/ + @Override public java.lang.Object clone() { diff --git a/java/src/Ice/InputStream.java b/java/src/Ice/InputStream.java index a6053154716..eaee07cf7b9 100644 --- a/java/src/Ice/InputStream.java +++ b/java/src/Ice/InputStream.java @@ -54,7 +54,7 @@ public interface InputStream * @return The extracted byte. **/ byte readByte(); - + /** * Extracts a sequence of byte values from the stream. * diff --git a/java/src/Ice/InputStreamI.java b/java/src/Ice/InputStreamI.java index 48c97fa3372..b26780bd834 100644 --- a/java/src/Ice/InputStreamI.java +++ b/java/src/Ice/InputStreamI.java @@ -45,132 +45,154 @@ public class InputStreamI implements InputStream _is.closure(this); } + @Override public Communicator communicator() { return _communicator; } + @Override public void sliceObjects(boolean slice) { _is.sliceObjects(slice); } + @Override public boolean readBool() { return _is.readBool(); } + @Override public boolean[] readBoolSeq() { return _is.readBoolSeq(); } + @Override public byte readByte() { return _is.readByte(); } + @Override public byte[] readByteSeq() { return _is.readByteSeq(); } + @Override public java.io.Serializable readSerializable() { return _is.readSerializable(); } + @Override public short readShort() { return _is.readShort(); } + @Override public short[] readShortSeq() { return _is.readShortSeq(); } + @Override public int readInt() { return _is.readInt(); } + @Override public int[] readIntSeq() { return _is.readIntSeq(); } + @Override public long readLong() { return _is.readLong(); } + @Override public long[] readLongSeq() { return _is.readLongSeq(); } + @Override public float readFloat() { return _is.readFloat(); } + @Override public float[] readFloatSeq() { return _is.readFloatSeq(); } + @Override public double readDouble() { return _is.readDouble(); } + @Override public double[] readDoubleSeq() { return _is.readDoubleSeq(); } + @Override public String readString() { return _is.readString(); } + @Override public String[] readStringSeq() { return _is.readStringSeq(); } + @Override public int readSize() { return _is.readSize(); } + @Override public int readAndCheckSeqSize(int minWire) { return _is.readAndCheckSeqSize(minWire); } + @Override public ObjectPrx readProxy() { @@ -184,12 +206,14 @@ public class InputStreamI implements InputStream _cb = cb; } + @Override public void patch(Ice.Object v) { _cb.invoke(v); } + @Override public String type() { @@ -199,18 +223,21 @@ public class InputStreamI implements InputStream ReadObjectCallback _cb; } + @Override public void readObject(ReadObjectCallback cb) { _is.readObject(new Patcher(cb)); } + @Override public int readEnum(int maxValue) { return _is.readEnum(maxValue); } + @Override public void throwException() throws UserException @@ -225,6 +252,7 @@ public class InputStreamI implements InputStream _factory = factory; } + @Override public void createAndThrow(String id) throws UserException @@ -232,6 +260,7 @@ public class InputStreamI implements InputStream _factory.createAndThrow(id); } + @Override public void destroy() { @@ -240,6 +269,7 @@ public class InputStreamI implements InputStream private UserExceptionReaderFactory _factory; } + @Override public void throwException(UserExceptionReaderFactory factory) throws UserException @@ -247,78 +277,91 @@ public class InputStreamI implements InputStream _is.throwException(new UserExceptionFactoryI(factory)); } + @Override public void startObject() { _is.startReadObject(); } + @Override public SlicedData endObject(boolean preserve) { return _is.endReadObject(preserve); } + @Override public void startException() { _is.startReadException(); } + @Override public SlicedData endException(boolean preserve) { return _is.endReadException(preserve); } + @Override public String startSlice() { return _is.startReadSlice(); } + @Override public void endSlice() { _is.endReadSlice(); } + @Override public void skipSlice() { _is.skipSlice(); } + @Override public Ice.EncodingVersion startEncapsulation() { return _is.startReadEncaps(); } + @Override public void endEncapsulation() { _is.endReadEncapsChecked(); } + @Override public Ice.EncodingVersion skipEncapsulation() { return _is.skipEncaps(); } + @Override public EncodingVersion getEncoding() { return _is.getReadEncoding(); } + @Override public void readPendingObjects() { _is.readPendingObjects(); } + @Override public void rewind() { @@ -326,30 +369,35 @@ public class InputStreamI implements InputStream _is.getBuffer().b.position(0); } + @Override public void skip(int sz) { _is.skip(sz); } + @Override public void skipSize() { _is.skipSize(); } + @Override public boolean readOptional(int tag, OptionalFormat format) { return _is.readOpt(tag, format); } + @Override public int pos() { return _is.pos(); } + @Override public void destroy() { diff --git a/java/src/Ice/LoggerI.java b/java/src/Ice/LoggerI.java index 3cc76af1da9..85bd4df2069 100644 --- a/java/src/Ice/LoggerI.java +++ b/java/src/Ice/LoggerI.java @@ -11,7 +11,7 @@ package Ice; public class LoggerI implements Logger { - public + public LoggerI(String prefix, String file) { if(prefix.length() > 0) @@ -37,6 +37,7 @@ public class LoggerI implements Logger } } + @Override public void print(String message) { @@ -45,6 +46,7 @@ public class LoggerI implements Logger write(s, false); } + @Override public void trace(String category, String message) { @@ -60,6 +62,7 @@ public class LoggerI implements Logger write(s, true); } + @Override public void warning(String message) { @@ -76,6 +79,7 @@ public class LoggerI implements Logger write(s, true); } + @Override public void error(String message) { @@ -92,6 +96,7 @@ public class LoggerI implements Logger write(s, true); } + @Override public Logger cloneWithPrefix(String prefix) { diff --git a/java/src/Ice/LoggerPlugin.java b/java/src/Ice/LoggerPlugin.java index 8ff9d16016a..dd0ae4767fa 100644 --- a/java/src/Ice/LoggerPlugin.java +++ b/java/src/Ice/LoggerPlugin.java @@ -25,7 +25,7 @@ public class LoggerPlugin implements Ice.Plugin * @param communicator The communicator using the custom logger. * @param logger The custom logger for the communicator. **/ - public + public LoggerPlugin(Communicator communicator, Logger logger) { if(communicator == null) @@ -51,7 +51,8 @@ public class LoggerPlugin implements Ice.Plugin * can override this method to perform any initialization that might be required * by a custom logger. **/ - public void + @Override + public void initialize() { } @@ -61,6 +62,7 @@ public class LoggerPlugin implements Ice.Plugin * can override this method to perform any finalization that might be required * by a custom logger. **/ + @Override public void destroy() { diff --git a/java/src/Ice/NativePropertiesAdmin.java b/java/src/Ice/NativePropertiesAdmin.java index e07ccc99d8b..c5b13bad937 100644 --- a/java/src/Ice/NativePropertiesAdmin.java +++ b/java/src/Ice/NativePropertiesAdmin.java @@ -11,6 +11,6 @@ package Ice; public interface NativePropertiesAdmin { - void addUpdateCallback(PropertiesAdminUpdateCallback callback); + void addUpdateCallback(PropertiesAdminUpdateCallback callback); void removeUpdateCallback(PropertiesAdminUpdateCallback callback); } diff --git a/java/src/Ice/Object.java b/java/src/Ice/Object.java index 271d10d4e25..b4712e8df24 100644 --- a/java/src/Ice/Object.java +++ b/java/src/Ice/Object.java @@ -157,7 +157,7 @@ public interface Object void __write(IceInternal.BasicStream __os); void __read(IceInternal.BasicStream __is); - + void __write(OutputStream __outS); void __read(InputStream __inS); diff --git a/java/src/Ice/ObjectAdapterI.java b/java/src/Ice/ObjectAdapterI.java index 05f79565a9d..6e2c67ac852 100644 --- a/java/src/Ice/ObjectAdapterI.java +++ b/java/src/Ice/ObjectAdapterI.java @@ -11,6 +11,7 @@ package Ice; public final class ObjectAdapterI implements ObjectAdapter { + @Override public String getName() { @@ -20,12 +21,14 @@ public final class ObjectAdapterI implements ObjectAdapter return _noConfig ? "" : _name; } + @Override public synchronized Communicator getCommunicator() { return _communicator; } + @Override public void activate() { @@ -122,6 +125,7 @@ public final class ObjectAdapterI implements ObjectAdapter } } + @Override public synchronized void hold() { @@ -133,6 +137,7 @@ public final class ObjectAdapterI implements ObjectAdapter } } + @Override public void waitForHold() { @@ -142,7 +147,7 @@ public final class ObjectAdapterI implements ObjectAdapter synchronized(this) { checkForDeactivation(); - + incomingConnectionFactories = new java.util.ArrayList<IceInternal.IncomingConnectionFactory>(_incomingConnectionFactories); @@ -160,13 +165,13 @@ public final class ObjectAdapterI implements ObjectAdapter { notifyAll(); } - + // - // If we don't need to retry, we're done. Otherwise, we wait until - // all the waiters finish waiting on the connections and we try - // again waiting on all the conncetions. This is necessary in the + // If we don't need to retry, we're done. Otherwise, we wait until + // all the waiters finish waiting on the connections and we try + // again waiting on all the conncetions. This is necessary in the // case activate() is called by another thread while waitForHold() - // waits on the some connection, if we didn't retry, waitForHold() + // waits on the some connection, if we didn't retry, waitForHold() // could return only after waiting on a subset of the connections. // if(!_waitForHoldRetry) @@ -192,6 +197,7 @@ public final class ObjectAdapterI implements ObjectAdapter } } + @Override public void deactivate() { @@ -278,6 +284,7 @@ public final class ObjectAdapterI implements ObjectAdapter outgoingConnectionFactory.removeAdapter(this); } + @Override public void waitForDeactivate() { @@ -320,12 +327,14 @@ public final class ObjectAdapterI implements ObjectAdapter } } + @Override public synchronized boolean isDeactivated() { return _deactivated; } + @Override public void destroy() { @@ -412,12 +421,14 @@ public final class ObjectAdapterI implements ObjectAdapter } } + @Override public ObjectPrx add(Ice.Object object, Identity ident) { return addFacet(object, ident, ""); } + @Override public synchronized ObjectPrx addFacet(Ice.Object object, Identity ident, String facet) { @@ -438,12 +449,14 @@ public final class ObjectAdapterI implements ObjectAdapter return newProxy(id, facet); } + @Override public ObjectPrx addWithUUID(Ice.Object object) { return addFacetWithUUID(object, ""); } + @Override public ObjectPrx addFacetWithUUID(Ice.Object object, String facet) { @@ -454,6 +467,7 @@ public final class ObjectAdapterI implements ObjectAdapter return addFacet(object, ident, facet); } + @Override public synchronized void addDefaultServant(Ice.Object servant, String category) { @@ -463,12 +477,14 @@ public final class ObjectAdapterI implements ObjectAdapter _servantManager.addDefaultServant(servant, category); } + @Override public Ice.Object remove(Identity ident) { return removeFacet(ident, ""); } + @Override public synchronized Ice.Object removeFacet(Identity ident, String facet) { @@ -478,6 +494,7 @@ public final class ObjectAdapterI implements ObjectAdapter return _servantManager.removeServant(ident, facet); } + @Override public synchronized java.util.Map<String, Ice.Object> removeAllFacets(Identity ident) { @@ -487,6 +504,7 @@ public final class ObjectAdapterI implements ObjectAdapter return _servantManager.removeAllFacets(ident); } + @Override public synchronized Ice.Object removeDefaultServant(String category) { @@ -495,12 +513,14 @@ public final class ObjectAdapterI implements ObjectAdapter return _servantManager.removeDefaultServant(category); } + @Override public Ice.Object find(Identity ident) { return findFacet(ident, ""); } + @Override public synchronized Ice.Object findFacet(Identity ident, String facet) { @@ -510,6 +530,7 @@ public final class ObjectAdapterI implements ObjectAdapter return _servantManager.findServant(ident, facet); } + @Override public synchronized java.util.Map<String, Ice.Object> findAllFacets(Identity ident) { @@ -519,6 +540,7 @@ public final class ObjectAdapterI implements ObjectAdapter return _servantManager.findAllFacets(ident); } + @Override public synchronized Ice.Object findByProxy(ObjectPrx proxy) { @@ -528,6 +550,7 @@ public final class ObjectAdapterI implements ObjectAdapter return findFacet(ref.getIdentity(), ref.getFacet()); } + @Override public synchronized Ice.Object findDefaultServant(String category) { @@ -536,6 +559,7 @@ public final class ObjectAdapterI implements ObjectAdapter return _servantManager.findDefaultServant(category); } + @Override public synchronized void addServantLocator(ServantLocator locator, String prefix) { @@ -544,6 +568,7 @@ public final class ObjectAdapterI implements ObjectAdapter _servantManager.addServantLocator(locator, prefix); } + @Override public synchronized ServantLocator removeServantLocator(String prefix) { @@ -552,6 +577,7 @@ public final class ObjectAdapterI implements ObjectAdapter return _servantManager.removeServantLocator(prefix); } + @Override public synchronized ServantLocator findServantLocator(String prefix) { @@ -560,6 +586,7 @@ public final class ObjectAdapterI implements ObjectAdapter return _servantManager.findServantLocator(prefix); } + @Override public synchronized ObjectPrx createProxy(Identity ident) { @@ -569,6 +596,7 @@ public final class ObjectAdapterI implements ObjectAdapter return newProxy(ident, ""); } + @Override public synchronized ObjectPrx createDirectProxy(Identity ident) { @@ -578,6 +606,7 @@ public final class ObjectAdapterI implements ObjectAdapter return newDirectProxy(ident, ""); } + @Override public synchronized ObjectPrx createIndirectProxy(Identity ident) { @@ -587,6 +616,7 @@ public final class ObjectAdapterI implements ObjectAdapter return newIndirectProxy(ident, "", _id); } + @Override public synchronized void setLocator(LocatorPrx locator) { @@ -595,6 +625,7 @@ public final class ObjectAdapterI implements ObjectAdapter _locatorInfo = _instance.locatorManager().get(locator); } + @Override public void refreshPublishedEndpoints() { @@ -636,6 +667,7 @@ public final class ObjectAdapterI implements ObjectAdapter } } + @Override public synchronized Endpoint[] getEndpoints() { @@ -647,6 +679,7 @@ public final class ObjectAdapterI implements ObjectAdapter return endpoints.toArray(new Endpoint[0]); } + @Override public synchronized Endpoint[] getPublishedEndpoints() { @@ -760,8 +793,8 @@ public final class ObjectAdapterI implements ObjectAdapter p.updateConnectionObservers(); } } - - public void + + public void updateThreadObservers() { IceInternal.ThreadPool threadPool = null; @@ -1049,6 +1082,7 @@ public final class ObjectAdapterI implements ObjectAdapter } } + @Override protected synchronized void finalize() throws Throwable @@ -1115,7 +1149,7 @@ public final class ObjectAdapterI implements ObjectAdapter // for(int i = 0; i < _routerEndpoints.size(); ++i) { - endpoints[sz + i] = (IceInternal.EndpointI)_routerEndpoints.get(i); + endpoints[sz + i] = _routerEndpoints.get(i); } // diff --git a/java/src/Ice/ObjectHolder.java b/java/src/Ice/ObjectHolder.java index cd9f9385afe..0fc2d4b6a8c 100644 --- a/java/src/Ice/ObjectHolder.java +++ b/java/src/Ice/ObjectHolder.java @@ -36,6 +36,7 @@ public final class ObjectHolder extends ObjectHolderBase<Ice.Object> * * @param v The new object for this holder. **/ + @Override public void patch(Ice.Object v) { @@ -48,6 +49,7 @@ public final class ObjectHolder extends ObjectHolderBase<Ice.Object> * * @return The Slice type ID. **/ + @Override public String type() { diff --git a/java/src/Ice/ObjectHolderBase.java b/java/src/Ice/ObjectHolderBase.java index 203471de1d7..45762db86bd 100644 --- a/java/src/Ice/ObjectHolderBase.java +++ b/java/src/Ice/ObjectHolderBase.java @@ -36,6 +36,7 @@ public abstract class ObjectHolderBase<T extends Ice.Object> implements ReadObje * * @param obj The new object for this holder. **/ + @Override public void invoke(Ice.Object obj) { diff --git a/java/src/Ice/ObjectImpl.java b/java/src/Ice/ObjectImpl.java index dcc4acdd52d..0f2924a9de5 100644 --- a/java/src/Ice/ObjectImpl.java +++ b/java/src/Ice/ObjectImpl.java @@ -28,6 +28,7 @@ public abstract class ObjectImpl implements Object, java.lang.Cloneable, java.io * * @return The cloned object. **/ + @Override public java.lang.Object clone() { @@ -55,6 +56,7 @@ public abstract class ObjectImpl implements Object, java.lang.Cloneable, java.io * @return The return value is <code>true</code> if <code>s</code> is * <code>::Ice::Object</code>. **/ + @Override public boolean ice_isA(String s) { @@ -69,6 +71,7 @@ public abstract class ObjectImpl implements Object, java.lang.Cloneable, java.io * @return The return value is <code>true</code> if <code>s</code> is * <code>::Ice::Object</code>. **/ + @Override public boolean ice_isA(String s, Current current) { @@ -91,6 +94,7 @@ public abstract class ObjectImpl implements Object, java.lang.Cloneable, java.io /** * Tests whether this object can be reached. **/ + @Override public void ice_ping() { @@ -102,6 +106,7 @@ public abstract class ObjectImpl implements Object, java.lang.Cloneable, java.io * * @param current The current object for the invocation. **/ + @Override public void ice_ping(Current current) { @@ -122,6 +127,7 @@ public abstract class ObjectImpl implements Object, java.lang.Cloneable, java.io * * @return An array whose only element is <code>::Ice::Object</code>. **/ + @Override public String[] ice_ids() { @@ -134,6 +140,7 @@ public abstract class ObjectImpl implements Object, java.lang.Cloneable, java.io * @param current The current object for the invocation. * @return An array whose only element is <code>::Ice::Object</code>. **/ + @Override public String[] ice_ids(Current current) { @@ -156,6 +163,7 @@ public abstract class ObjectImpl implements Object, java.lang.Cloneable, java.io * * @return The return value is always <code>::Ice::Object</code>. **/ + @Override public String ice_id() { @@ -168,6 +176,7 @@ public abstract class ObjectImpl implements Object, java.lang.Cloneable, java.io * @param current The current object for the invocation. * @return The return value is always {@link IceObject}. **/ + @Override public String ice_id(Current current) { @@ -221,6 +230,7 @@ public abstract class ObjectImpl implements Object, java.lang.Cloneable, java.io * * @see Freeze.TransactionalEvictor **/ + @Override public int ice_operationAttributes(String operation) { return 0; @@ -230,6 +240,7 @@ public abstract class ObjectImpl implements Object, java.lang.Cloneable, java.io * The Ice run time invokes this method prior to marshaling an object's data members. This allows a subclass * to override this method in order to validate its data members. This default implementation does nothing. **/ + @Override public void ice_preMarshal() { @@ -240,6 +251,7 @@ public abstract class ObjectImpl implements Object, java.lang.Cloneable, java.io * subclass to override this method in order to perform additional initialization. This default * implementation does nothing. **/ + @Override public void ice_postUnmarshal() { @@ -266,6 +278,7 @@ public abstract class ObjectImpl implements Object, java.lang.Cloneable, java.io * @see DispatchInterceptorAsyncCallback * @see DispatchStatus **/ + @Override public DispatchStatus ice_dispatch(Request request, DispatchInterceptorAsyncCallback cb) { @@ -298,12 +311,14 @@ public abstract class ObjectImpl implements Object, java.lang.Cloneable, java.io * @see DispatchInterceptor * @see DispatchStatus **/ + @Override public DispatchStatus ice_dispatch(Request request) { return ice_dispatch(request, null); } + @Override public DispatchStatus __dispatch(IceInternal.Incoming in, Current current) { @@ -337,6 +352,7 @@ public abstract class ObjectImpl implements Object, java.lang.Cloneable, java.io throw new Ice.OperationNotExistException(current.id, current.facet, current.operation); } + @Override public void __write(IceInternal.BasicStream os) { @@ -345,6 +361,7 @@ public abstract class ObjectImpl implements Object, java.lang.Cloneable, java.io os.endWriteObject(); } + @Override public void __read(IceInternal.BasicStream is) { @@ -353,6 +370,7 @@ public abstract class ObjectImpl implements Object, java.lang.Cloneable, java.io is.endReadObject(false); } + @Override public void __write(OutputStream os) { @@ -361,6 +379,7 @@ public abstract class ObjectImpl implements Object, java.lang.Cloneable, java.io os.endObject(); } + @Override public void __read(InputStream is) { @@ -378,7 +397,7 @@ public abstract class ObjectImpl implements Object, java.lang.Cloneable, java.io __readImpl(IceInternal.BasicStream is) { } - + protected void __writeImpl(OutputStream os) { diff --git a/java/src/Ice/ObjectPrx.java b/java/src/Ice/ObjectPrx.java index b14dfd7ec83..eddfec7e8f7 100644 --- a/java/src/Ice/ObjectPrx.java +++ b/java/src/Ice/ObjectPrx.java @@ -1208,5 +1208,6 @@ public interface ObjectPrx * @param r The object to compare this proxy with. * @return <code>true</code> if this proxy is equal to <code>r</code>; <code>false</code>, otherwise. **/ + @Override boolean equals(java.lang.Object r); } diff --git a/java/src/Ice/ObjectPrxHelper.java b/java/src/Ice/ObjectPrxHelper.java index 14bbc89f4da..45c290df6e2 100644 --- a/java/src/Ice/ObjectPrxHelper.java +++ b/java/src/Ice/ObjectPrxHelper.java @@ -144,15 +144,15 @@ public class ObjectPrxHelper extends ObjectPrxHelperBase } /** - * Returns the Slice type id of the interface or class associated + * Returns the Slice type id of the interface or class associated * with this proxy class. * - * @return the type id, "::Ice::Object" - **/ + * @return the type id, "::Ice::Object" + **/ public static String ice_staticId() { - return Ice.ObjectImpl.ice_staticId(); + return Ice.ObjectImpl.ice_staticId(); } } diff --git a/java/src/Ice/ObjectPrxHelperBase.java b/java/src/Ice/ObjectPrxHelperBase.java index d223654a3d0..27504e0d4c2 100644 --- a/java/src/Ice/ObjectPrxHelperBase.java +++ b/java/src/Ice/ObjectPrxHelperBase.java @@ -21,6 +21,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * * @return The hash code. **/ + @Override public final int hashCode() { @@ -32,6 +33,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * * @return The communicator that created this proxy. **/ + @Override public final Communicator ice_getCommunicator() { @@ -43,6 +45,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * * @return The stringified proxy. **/ + @Override public final String toString() { @@ -55,6 +58,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __id The Slice type ID of an interface. * @return <code>true</code> if this proxy supports the specified interface; <code>false</code>, otherwise. **/ + @Override public final boolean ice_isA(String __id) { @@ -68,6 +72,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __context The <code>Context</code> map for the invocation. * @return <code>true</code> if this proxy supports the specified interface; <code>false</code>, otherwise. **/ + @Override public final boolean ice_isA(String __id, java.util.Map<String, String> __context) { @@ -121,6 +126,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __id The Slice type ID of an interface. * @return The asynchronous result object. **/ + @Override public final AsyncResult begin_ice_isA(String __id) { @@ -134,6 +140,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __context The <code>Context</code> map for the invocation. * @return The asynchronous result object. **/ + @Override public final AsyncResult begin_ice_isA(String __id, java.util.Map<String, String> __context) { @@ -147,6 +154,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __cb The asynchronous callback object. * @return The asynchronous result object. **/ + @Override public final AsyncResult begin_ice_isA(String __id, Callback __cb) { @@ -161,6 +169,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __cb The asynchronous callback object. * @return The asynchronous result object. **/ + @Override public final AsyncResult begin_ice_isA(String __id, java.util.Map<String, String> __context, Callback __cb) { @@ -174,6 +183,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __cb The asynchronous callback object. * @return The asynchronous result object. **/ + @Override public final AsyncResult begin_ice_isA(String __id, Callback_Object_ice_isA __cb) { @@ -188,12 +198,13 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __cb The asynchronous callback object. * @return The asynchronous result object. **/ + @Override public final AsyncResult begin_ice_isA(String __id, java.util.Map<String, String> __context, Callback_Object_ice_isA __cb) { return begin_ice_isA(__id, __context, true, __cb); } - + /** * Tests whether this proxy supports a given interface. * @@ -202,14 +213,15 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __exceptionCb The asynchronous exception callback object. * @return The asynchronous result object. **/ + @Override public final AsyncResult - begin_ice_isA(String __id, - IceInternal.Functional_BoolCallback __responseCb, + begin_ice_isA(String __id, + IceInternal.Functional_BoolCallback __responseCb, IceInternal.Functional_GenericCallback1<Ice.Exception> __exceptionCb) { return begin_ice_isA(__id, null, false, __responseCb, __exceptionCb, null); } - + /** * Tests whether this proxy supports a given interface. * @@ -219,9 +231,10 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __sentCb The asynchronous sent callback object. * @return The asynchronous result object. **/ + @Override public final AsyncResult - begin_ice_isA(String __id, - IceInternal.Functional_BoolCallback __responseCb, + begin_ice_isA(String __id, + IceInternal.Functional_BoolCallback __responseCb, IceInternal.Functional_GenericCallback1<Ice.Exception> __exceptionCb, IceInternal.Functional_BoolCallback __sentCb) { @@ -237,15 +250,16 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __exceptionCb The asynchronous exception callback object. * @return The asynchronous result object. **/ + @Override public final AsyncResult begin_ice_isA(String __id, - java.util.Map<String, String> __context, - IceInternal.Functional_BoolCallback __responseCb, + java.util.Map<String, String> __context, + IceInternal.Functional_BoolCallback __responseCb, IceInternal.Functional_GenericCallback1<Ice.Exception> __exceptionCb) { return begin_ice_isA(__id, __context, true, __responseCb, __exceptionCb, null); } - + /** * Tests whether this proxy supports a given interface. * @@ -256,27 +270,29 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __sentCb The asynchronous sent callback object. * @return The asynchronous result object. **/ + @Override public final AsyncResult begin_ice_isA(String __id, - java.util.Map<String, String> __context, - IceInternal.Functional_BoolCallback __responseCb, + java.util.Map<String, String> __context, + IceInternal.Functional_BoolCallback __responseCb, IceInternal.Functional_GenericCallback1<Ice.Exception> __exceptionCb, IceInternal.Functional_BoolCallback __sentCb) { return begin_ice_isA(__id, __context, true, __responseCb, __exceptionCb, __sentCb); } - + private final AsyncResult begin_ice_isA(String __id, java.util.Map<String, String> __context, boolean __explicitCtx, - IceInternal.Functional_BoolCallback __responseCb, + IceInternal.Functional_BoolCallback __responseCb, IceInternal.Functional_GenericCallback1<Ice.Exception> __exceptionCb, IceInternal.Functional_BoolCallback __sentCb) { return begin_ice_isA(__id, __context, __explicitCtx, new IceInternal.Functional_TwowayCallbackBool(__responseCb, __exceptionCb, __sentCb) { + @Override public final void __completed(AsyncResult __result) { ObjectPrxHelperBase.__ice_isA_completed(this, __result); @@ -311,6 +327,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __result The asynchronous result. * @return <code>true</code> if this proxy supports the specified interface; <code>false</code>, otherwise. **/ + @Override public final boolean end_ice_isA(AsyncResult __result) { @@ -332,7 +349,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable __result.__endReadParams(); return __ret; } - + static public final void __ice_isA_completed(TwowayCallbackBool __cb, Ice.AsyncResult __result) { boolean __ret = false; @@ -356,6 +373,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable /** * Tests whether the target object of this proxy can be reached. **/ + @Override public final void ice_ping() { @@ -367,6 +385,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * * @param __context The <code>Context</code> map for the invocation. **/ + @Override public final void ice_ping(java.util.Map<String, String> __context) { @@ -395,6 +414,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * * @return The asynchronous result object. **/ + @Override public final AsyncResult begin_ice_ping() { @@ -407,6 +427,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __context The context map for the invocation. * @return The asynchronous result object. **/ + @Override public final AsyncResult begin_ice_ping(java.util.Map<String, String> __context) { @@ -419,6 +440,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __cb The asynchronous callback object. * @return The asynchronous result object. **/ + @Override public final AsyncResult begin_ice_ping(Callback __cb) { @@ -432,6 +454,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __cb The asynchronous callback object. * @return The asynchronous result object. **/ + @Override public final AsyncResult begin_ice_ping(java.util.Map<String, String> __context, Callback __cb) { @@ -444,6 +467,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __cb The asynchronous callback object. * @return The asynchronous result object. **/ + @Override public final AsyncResult begin_ice_ping(Callback_Object_ice_ping __cb) { @@ -457,12 +481,13 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __cb The asynchronous callback object. * @return The asynchronous result object. **/ + @Override public final AsyncResult begin_ice_ping(java.util.Map<String, String> __context, Callback_Object_ice_ping __cb) { return begin_ice_ping(__context, true, __cb); } - + /** * Tests whether the target object of this proxy can be reached. * @@ -470,14 +495,15 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __exceptionCb The asynchronous exception callback object. * @return The asynchronous result object. **/ + @Override public final AsyncResult - begin_ice_ping(IceInternal.Functional_VoidCallback __responseCb, + begin_ice_ping(IceInternal.Functional_VoidCallback __responseCb, IceInternal.Functional_GenericCallback1<Ice.Exception> __exceptionCb) { - return begin_ice_ping(null, false, + return begin_ice_ping(null, false, new IceInternal.Functional_OnewayCallback(__responseCb, __exceptionCb, null)); } - + /** * Tests whether the target object of this proxy can be reached. * @@ -486,15 +512,16 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __sentCb The asynchronous sent callback object. * @return The asynchronous result object. **/ + @Override public final AsyncResult - begin_ice_ping(IceInternal.Functional_VoidCallback __responseCb, + begin_ice_ping(IceInternal.Functional_VoidCallback __responseCb, IceInternal.Functional_GenericCallback1<Ice.Exception> __exceptionCb, IceInternal.Functional_BoolCallback __sentCb) { - return begin_ice_ping(null, false, new + return begin_ice_ping(null, false, new IceInternal.Functional_OnewayCallback(__responseCb, __exceptionCb, __sentCb)); } - + /** * Tests whether the target object of this proxy can be reached. * @@ -503,15 +530,16 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __exceptionCb The asynchronous exception callback object. * @return The asynchronous result object. **/ + @Override public final AsyncResult - begin_ice_ping(java.util.Map<String, String> __context, - IceInternal.Functional_VoidCallback __responseCb, + begin_ice_ping(java.util.Map<String, String> __context, + IceInternal.Functional_VoidCallback __responseCb, IceInternal.Functional_GenericCallback1<Ice.Exception> __exceptionCb) { - return begin_ice_ping(__context, true, + return begin_ice_ping(__context, true, new IceInternal.Functional_OnewayCallback(__responseCb, __exceptionCb, null)); } - + /** * Tests whether the target object of this proxy can be reached. * @@ -521,13 +549,14 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __sentCb The asynchronous sent callback object. * @return The asynchronous result object. **/ + @Override public final AsyncResult begin_ice_ping(java.util.Map<String, String> __context, - IceInternal.Functional_VoidCallback __responseCb, + IceInternal.Functional_VoidCallback __responseCb, IceInternal.Functional_GenericCallback1<Ice.Exception> __exceptionCb, IceInternal.Functional_BoolCallback __sentCb) { - return begin_ice_ping(__context, true, + return begin_ice_ping(__context, true, new IceInternal.Functional_OnewayCallback(__responseCb, __exceptionCb, __sentCb)); } @@ -553,6 +582,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * * @param __result The asynchronous result. **/ + @Override public final void end_ice_ping(AsyncResult __result) { @@ -565,6 +595,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @return The Slice type IDs of the interfaces supported by the target object, in base-to-derived * order. The first element of the returned array is always <code>::Ice::Object</code>. **/ + @Override public final String[] ice_ids() { @@ -578,6 +609,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @return The Slice type IDs of the interfaces supported by the target object, in base-to-derived * order. The first element of the returned array is always <code>::Ice::Object</code>. **/ + @Override public final String[] ice_ids(java.util.Map<String, String> __context) { @@ -621,6 +653,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * * @return The asynchronous result object. **/ + @Override public final AsyncResult begin_ice_ids() { @@ -633,6 +666,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __context The context map for the invocation. * @return The asynchronous result object. **/ + @Override public final AsyncResult begin_ice_ids(java.util.Map<String, String> __context) { @@ -645,6 +679,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __cb The asynchronous callback object. * @return The asynchronous result object. **/ + @Override public final AsyncResult begin_ice_ids(Callback __cb) { @@ -658,6 +693,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __cb The asynchronous callback object. * @return The asynchronous result object. **/ + @Override public final AsyncResult begin_ice_ids(java.util.Map<String, String> __context, Callback __cb) { @@ -670,6 +706,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __cb The asynchronous callback object. * @return The asynchronous result object. **/ + @Override public final AsyncResult begin_ice_ids(Callback_Object_ice_ids __cb) { @@ -683,12 +720,13 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __cb The asynchronous callback object. * @return The asynchronous result object. **/ + @Override public final AsyncResult begin_ice_ids(java.util.Map<String, String> __context, Callback_Object_ice_ids __cb) { return begin_ice_ids(__context, true, __cb); } - + class FunctionalCallback_Object_ice_ids extends IceInternal.Functional_TwowayCallbackArg1<String[]> { FunctionalCallback_Object_ice_ids(IceInternal.Functional_GenericCallback1<String[]> __responseCb, @@ -697,13 +735,14 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable { super(__responseCb, __exceptionCb, __sentCb); } - + + @Override public final void __completed(AsyncResult __result) { ObjectPrxHelperBase.__ice_ids_completed(this, __result); } } - + /** * Returns the Slice type IDs of the interfaces supported by the target object of this proxy. * @@ -711,13 +750,14 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __exceptionCb The asynchronous exception callback object. * @return The asynchronous result object. **/ + @Override public final AsyncResult - begin_ice_ids(IceInternal.Functional_GenericCallback1<String[]> __responseCb, + begin_ice_ids(IceInternal.Functional_GenericCallback1<String[]> __responseCb, IceInternal.Functional_GenericCallback1<Ice.Exception> __exceptionCb) { return begin_ice_ids(null, false, new FunctionalCallback_Object_ice_ids(__responseCb, __exceptionCb, null)); } - + /** * Returns the Slice type IDs of the interfaces supported by the target object of this proxy. * @@ -726,15 +766,16 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __sentCb The asynchronous sent callback object. * @return The asynchronous result object. **/ + @Override public final AsyncResult - begin_ice_ids(IceInternal.Functional_GenericCallback1<String[]> __responseCb, + begin_ice_ids(IceInternal.Functional_GenericCallback1<String[]> __responseCb, IceInternal.Functional_GenericCallback1<Ice.Exception> __exceptionCb, IceInternal.Functional_BoolCallback __sentCb) { - return begin_ice_ids(null, false, + return begin_ice_ids(null, false, new FunctionalCallback_Object_ice_ids(__responseCb, __exceptionCb, __sentCb)); } - + /** * Returns the Slice type IDs of the interfaces supported by the target object of this proxy. * @@ -743,15 +784,16 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __exceptionCb The asynchronous exception callback object. * @return The asynchronous result object. **/ + @Override public final AsyncResult begin_ice_ids(java.util.Map<String, String> __context, - IceInternal.Functional_GenericCallback1<String[]> __responseCb, + IceInternal.Functional_GenericCallback1<String[]> __responseCb, IceInternal.Functional_GenericCallback1<Ice.Exception> __exceptionCb) { - return begin_ice_ids(__context, true, + return begin_ice_ids(__context, true, new FunctionalCallback_Object_ice_ids(__responseCb, __exceptionCb, null)); } - + /** * Returns the Slice type IDs of the interfaces supported by the target object of this proxy. * @@ -761,26 +803,28 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __sentCb The asynchronous sent callback object. * @return The asynchronous result object. **/ + @Override public final AsyncResult begin_ice_ids(java.util.Map<String, String> __context, - IceInternal.Functional_GenericCallback1<String[]> __responseCb, + IceInternal.Functional_GenericCallback1<String[]> __responseCb, IceInternal.Functional_GenericCallback1<Ice.Exception> __exceptionCb, IceInternal.Functional_BoolCallback __sentCb) { - return begin_ice_ids(__context, true, + return begin_ice_ids(__context, true, new FunctionalCallback_Object_ice_ids(__responseCb, __exceptionCb, __sentCb)); } - + private final AsyncResult begin_ice_ids(java.util.Map<String, String> __context, boolean __explicitCtx, - IceInternal.Functional_GenericCallback1<String[]> __responseCb, + IceInternal.Functional_GenericCallback1<String[]> __responseCb, IceInternal.Functional_GenericCallback1<Ice.Exception> __exceptionCb, IceInternal.Functional_BoolCallback __sentCb) { - return begin_ice_ids(__context, true, + return begin_ice_ids(__context, true, new IceInternal.Functional_TwowayCallbackArg1<String[]>(__responseCb, __exceptionCb, __sentCb) { + @Override public final void __completed(AsyncResult __result) { ObjectPrxHelperBase.__ice_ids_completed(this, __result); @@ -813,6 +857,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @return The Slice type IDs of the interfaces supported by the target object, in base-to-derived * order. The first element of the returned array is always <code>::Ice::Object</code>. **/ + @Override public final String[] end_ice_ids(AsyncResult __result) { @@ -834,7 +879,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable __result.__endReadParams(); return __ret; } - + static public final void __ice_ids_completed(TwowayCallbackArg1<String[]> __cb, AsyncResult __result) { String[] __ret = null; @@ -860,6 +905,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * * @return The Slice type ID of the most-derived interface. **/ + @Override public final String ice_id() { @@ -872,6 +918,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __context The <code>Context</code> map for the invocation. * @return The Slice type ID of the most-derived interface. **/ + @Override public final String ice_id(java.util.Map<String, String> __context) { @@ -915,6 +962,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * * @return The asynchronous result object. **/ + @Override public final AsyncResult begin_ice_id() { @@ -927,6 +975,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __context The context map for the invocation. * @return The asynchronous result object. **/ + @Override public final AsyncResult begin_ice_id(java.util.Map<String, String> __context) { @@ -939,6 +988,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __cb The asynchronous callback object. * @return The asynchronous result object. **/ + @Override public final AsyncResult begin_ice_id(Callback __cb) { @@ -952,6 +1002,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __cb The asynchronous callback object. * @return The asynchronous result object. **/ + @Override public final AsyncResult begin_ice_id(java.util.Map<String, String> __context, Callback __cb) { @@ -964,6 +1015,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __cb The asynchronous callback object. * @return The asynchronous result object. **/ + @Override public final AsyncResult begin_ice_id(Callback_Object_ice_id __cb) { @@ -977,12 +1029,13 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __cb The asynchronous callback object. * @return The asynchronous result object. **/ + @Override public final AsyncResult begin_ice_id(java.util.Map<String, String> __context, Callback_Object_ice_id __cb) { return begin_ice_id(__context, true, __cb); } - + class FunctionalCallback_Object_ice_id extends IceInternal.Functional_TwowayCallbackArg1<String> { FunctionalCallback_Object_ice_id(IceInternal.Functional_GenericCallback1<String> responseCb, @@ -991,13 +1044,14 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable { super(responseCb, exceptionCb, sentCb); } - + + @Override public final void __completed(AsyncResult __result) { ObjectPrxHelperBase.__ice_id_completed(this, __result); } } - + /** * Returns the Slice type ID of the most-derived interface supported by the target object of this proxy. * @@ -1005,13 +1059,14 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __exceptionCb The asynchronous exception callback object. * @return The asynchronous result object. **/ + @Override public final AsyncResult - begin_ice_id(IceInternal.Functional_GenericCallback1<String> __responseCb, + begin_ice_id(IceInternal.Functional_GenericCallback1<String> __responseCb, IceInternal.Functional_GenericCallback1<Ice.Exception> __exceptionCb) { return begin_ice_id(null, false, new FunctionalCallback_Object_ice_id(__responseCb, __exceptionCb, null)); } - + /** * Returns the Slice type ID of the most-derived interface supported by the target object of this proxy. * @@ -1020,14 +1075,15 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __sentCb The asynchronous sent callback object. * @return The asynchronous result object. **/ + @Override public final AsyncResult - begin_ice_id(IceInternal.Functional_GenericCallback1<String> __responseCb, + begin_ice_id(IceInternal.Functional_GenericCallback1<String> __responseCb, IceInternal.Functional_GenericCallback1<Ice.Exception> __exceptionCb, IceInternal.Functional_BoolCallback __sentCb) { return begin_ice_id(null, false, new FunctionalCallback_Object_ice_id(__responseCb, __exceptionCb, __sentCb)); } - + /** * Returns the Slice type ID of the most-derived interface supported by the target object of this proxy. * @@ -1036,14 +1092,15 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __exceptionCb The asynchronous exception callback object. * @return The asynchronous result object. **/ + @Override public final AsyncResult begin_ice_id(java.util.Map<String, String> __context, - IceInternal.Functional_GenericCallback1<String> __responseCb, + IceInternal.Functional_GenericCallback1<String> __responseCb, IceInternal.Functional_GenericCallback1<Ice.Exception> __exceptionCb) { return begin_ice_id(__context, true, new FunctionalCallback_Object_ice_id(__responseCb, __exceptionCb, null)); } - + /** * Returns the Slice type ID of the most-derived interface supported by the target object of this proxy. * @@ -1053,13 +1110,14 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __sentCb The asynchronous sent callback object. * @return The asynchronous result object. **/ + @Override public final AsyncResult begin_ice_id(java.util.Map<String, String> __context, - IceInternal.Functional_GenericCallback1<String> __responseCb, + IceInternal.Functional_GenericCallback1<String> __responseCb, IceInternal.Functional_GenericCallback1<Ice.Exception> __exceptionCb, IceInternal.Functional_BoolCallback __sentCb) { - return begin_ice_id(__context, true, + return begin_ice_id(__context, true, new FunctionalCallback_Object_ice_id(__responseCb, __exceptionCb, __sentCb)); } @@ -1087,6 +1145,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __result The asynchronous result. * @return The Slice type ID of the most-derived interface. **/ + @Override public final String end_ice_id(AsyncResult __result) { @@ -1108,7 +1167,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable __result.__endReadParams(); return __ret; } - + static public final void __ice_id_completed(TwowayCallbackArg1<String> __cb, AsyncResult __result) { String __ret = null; @@ -1146,6 +1205,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @see Blobject * @see OperationMode **/ + @Override public final boolean ice_invoke(String operation, OperationMode mode, byte[] inParams, ByteSeqHolder outParams) { @@ -1168,6 +1228,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @see Blobject * @see OperationMode **/ + @Override public final boolean ice_invoke(String operation, OperationMode mode, byte[] inParams, ByteSeqHolder outParams, java.util.Map<String, String> context) @@ -1186,7 +1247,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable boolean ok = __og.invoke(); if(_reference.getMode() == IceInternal.Reference.ModeTwoway) { - if(outParams != null) + if(outParams != null) { outParams.value = __og.readParamEncaps(); } @@ -1212,6 +1273,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @see Blobject * @see OperationMode **/ + @Override public final AsyncResult begin_ice_invoke(String operation, OperationMode mode, byte[] inParams) { @@ -1231,6 +1293,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @see Blobject * @see OperationMode **/ + @Override public final AsyncResult begin_ice_invoke(String operation, OperationMode mode, byte[] inParams, java.util.Map<String, String> __context) @@ -1251,6 +1314,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @see Blobject * @see OperationMode **/ + @Override public final AsyncResult begin_ice_invoke(String operation, OperationMode mode, byte[] inParams, Callback __cb) { @@ -1271,6 +1335,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @see Blobject * @see OperationMode **/ + @Override public final AsyncResult begin_ice_invoke(String operation, OperationMode mode, byte[] inParams, java.util.Map<String, String> __context, Callback __cb) @@ -1291,6 +1356,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @see Blobject * @see OperationMode **/ + @Override public final AsyncResult begin_ice_invoke(String operation, OperationMode mode, byte[] inParams, Callback_Object_ice_invoke __cb) { @@ -1311,13 +1377,14 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @see Blobject * @see OperationMode **/ + @Override public final AsyncResult begin_ice_invoke(String operation, OperationMode mode, byte[] inParams, java.util.Map<String, String> __context, Callback_Object_ice_invoke __cb) { return begin_ice_invoke(operation, mode, inParams, __context, true, __cb); } - + /** * Invokes an operation dynamically and asynchronously. * @@ -1333,6 +1400,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @see Blobject * @see OperationMode **/ + @Override public final AsyncResult begin_ice_invoke(String operation, OperationMode mode, byte[] inParams, FunctionalCallback_Object_ice_invoke_Response responseCb, IceInternal.Functional_GenericCallback1<Ice.Exception> exceptionCb, @@ -1340,7 +1408,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable { return begin_ice_invoke(operation, mode, inParams, null, false, responseCb, exceptionCb, sentCb); } - + /** * Invokes an operation dynamically and asynchronously. * @@ -1355,13 +1423,14 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @see Blobject * @see OperationMode **/ + @Override public final AsyncResult begin_ice_invoke(String operation, OperationMode mode, byte[] inParams, FunctionalCallback_Object_ice_invoke_Response responseCb, IceInternal.Functional_GenericCallback1<Ice.Exception> exceptionCb) { return begin_ice_invoke(operation, mode, inParams, null, false, responseCb, exceptionCb, null); } - + /** * Invokes an operation dynamically and asynchronously. * @@ -1378,6 +1447,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @see Blobject * @see OperationMode **/ + @Override public final AsyncResult begin_ice_invoke(String operation, OperationMode mode, byte[] inParams, java.util.Map<String, String> context, FunctionalCallback_Object_ice_invoke_Response responseCb, @@ -1386,7 +1456,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable { return begin_ice_invoke(operation, mode, inParams, context, true, responseCb, exceptionCb, sentCb); } - + /** * Invokes an operation dynamically and asynchronously. * @@ -1402,6 +1472,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @see Blobject * @see OperationMode **/ + @Override public final AsyncResult begin_ice_invoke(String operation, OperationMode mode, byte[] inParams, java.util.Map<String, String> context, FunctionalCallback_Object_ice_invoke_Response responseCb, @@ -1409,7 +1480,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable { return begin_ice_invoke(operation, mode, inParams, context, true, responseCb, exceptionCb, null); } - + private final AsyncResult begin_ice_invoke(String operation, OperationMode mode, byte[] inParams, java.util.Map<String, String> __context, boolean __explicitCtx, @@ -1426,17 +1497,19 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable super(responseCb != null, exceptionCb, sentCb); __responseCb = responseCb; } - + + @Override public void response(boolean __ret, byte[] outParams) { __responseCb.apply(__ret, outParams); } - + + @Override public final void __completed(AsyncResult __result) { ObjectPrxHelperBase.__ice_invoke_completed(this, __result); } - + FunctionalCallback_Object_ice_invoke_Response __responseCb; } return begin_ice_invoke(operation, mode, inParams, __context, __explicitCtx, @@ -1472,6 +1545,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * contains the encoded user exception. If the operation raises a run-time exception, * it throws it directly. **/ + @Override public final boolean end_ice_invoke(ByteSeqHolder outParams, AsyncResult __result) { @@ -1486,7 +1560,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable } return ok; } - + public static void __ice_invoke_completed(_Callback_Object_ice_invoke __cb, AsyncResult __result) { ByteSeqHolder outParams = new ByteSeqHolder(); @@ -1522,6 +1596,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @see AMI_Object_ice_invoke * @see OperationMode **/ + @Override public final boolean ice_invoke_async(AMI_Object_ice_invoke cb, String operation, OperationMode mode, byte[] inParams) { @@ -1544,6 +1619,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @see AMI_Object_ice_invoke * @see OperationMode **/ + @Override public final boolean ice_invoke_async(AMI_Object_ice_invoke cb, String operation, OperationMode mode, byte[] inParams, java.util.Map<String, String> context) @@ -1557,6 +1633,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * * @return The identity of the target object. **/ + @Override public final Identity ice_getIdentity() { @@ -1569,6 +1646,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param newIdentity The identity for the new proxy. * @return The proxy with the new identity. **/ + @Override public final ObjectPrx ice_identity(Identity newIdentity) { @@ -1594,6 +1672,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @return The per-proxy context. If the proxy does not have a per-proxy (implicit) context, the return value * is <code>null</code>. **/ + @Override public final java.util.Map<String, String> ice_getContext() { @@ -1606,6 +1685,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param newContext The context for the new proxy. * @return The proxy with the new per-proxy context. **/ + @Override public final ObjectPrx ice_context(java.util.Map<String, String> newContext) { @@ -1617,6 +1697,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * * @return The facet for this proxy. If the proxy uses the default facet, the return value is the empty string. **/ + @Override public final String ice_getFacet() { @@ -1629,6 +1710,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param newFacet The facet for the new proxy. * @return The proxy with the new facet. **/ + @Override public final ObjectPrx ice_facet(String newFacet) { @@ -1654,6 +1736,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * * @return The adapter ID. If the proxy does not have an adapter ID, the return value is the empty string. **/ + @Override public final String ice_getAdapterId() { @@ -1666,6 +1749,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param newAdapterId The adapter ID for the new proxy. * @return The proxy with the new adapter ID. **/ + @Override public final ObjectPrx ice_adapterId(String newAdapterId) { @@ -1691,6 +1775,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * * @see Endpoint **/ + @Override public final Endpoint[] ice_getEndpoints() { @@ -1703,6 +1788,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param newEndpoints The endpoints for the new proxy. * @return The proxy with the new endpoints. **/ + @Override public final ObjectPrx ice_endpoints(Endpoint[] newEndpoints) { @@ -1713,7 +1799,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable else { IceInternal.EndpointI[] edpts = new IceInternal.EndpointI[newEndpoints.length]; - edpts = (IceInternal.EndpointI[])java.util.Arrays.asList(newEndpoints).toArray(edpts); + edpts = java.util.Arrays.asList(newEndpoints).toArray(edpts); return newInstance(_reference.changeEndpoints(edpts)); } } @@ -1725,6 +1811,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * * @see Locator **/ + @Override public final int ice_getLocatorCacheTimeout() { @@ -1736,6 +1823,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * * @return The invocation timeout value (in seconds). **/ + @Override public final int ice_getInvocationTimeout() { @@ -1748,6 +1836,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @return The connection id. * **/ + @Override public final String ice_getConnectionId() { @@ -1761,6 +1850,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * * @see Locator **/ + @Override public final ObjectPrx ice_locatorCacheTimeout(int newTimeout) { @@ -1779,6 +1869,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * * @param newTimeout The new invocation timeout (in seconds). **/ + @Override public final ObjectPrx ice_invocationTimeout(int newTimeout) { @@ -1797,6 +1888,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * * @return <code>true</code> if this proxy caches connections; <code>false</code>, otherwise. **/ + @Override public final boolean ice_isConnectionCached() { @@ -1809,6 +1901,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param newCache <code>true</code> if the new proxy should cache connections; <code>false</code>, otherwise. * @return The new proxy with the specified caching policy. **/ + @Override public final ObjectPrx ice_connectionCached(boolean newCache) { @@ -1829,6 +1922,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * * @see EndpointSelectionType **/ + @Override public final Ice.EndpointSelectionType ice_getEndpointSelection() { @@ -1843,6 +1937,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * * @see EndpointSelectionType **/ + @Override public final ObjectPrx ice_endpointSelection(Ice.EndpointSelectionType newType) { @@ -1861,6 +1956,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * * @return <code>true</code> if all endpoints for this proxy are secure; <code>false</code>, otherwise. **/ + @Override public final boolean ice_isSecure() { @@ -1874,6 +1970,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * retained for the new proxy. If <code>b</code> is false, the returned proxy is identical to this proxy. * @return The new proxy with possible different endpoints.k **/ + @Override public final ObjectPrx ice_secure(boolean b) { @@ -1894,6 +1991,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param e The encoding version to use to marshal requests parameters. * @return The new proxy with the specified encoding version. **/ + @Override public final ObjectPrx ice_encodingVersion(Ice.EncodingVersion e) { @@ -1912,7 +2010,8 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * * @return The encoding version. **/ - public final Ice.EncodingVersion + @Override + public final Ice.EncodingVersion ice_getEncodingVersion() { return (Ice.EncodingVersion)_reference.getEncoding().clone(); @@ -1924,6 +2023,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @return <code>true</code> if the proxy always attempts to invoke via secure endpoints before it * attempts to use insecure endpoints; <code>false</code>, otherwise; **/ + @Override public final boolean ice_isPreferSecure() { @@ -1938,6 +2038,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * <code>false</code>, the proxy prefers insecure endpoints to secure ones. * @return The new proxy with the new endpoint selection policy. **/ + @Override public final ObjectPrx ice_preferSecure(boolean b) { @@ -1957,6 +2058,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @return The router for the proxy. If no router is configured for the proxy, the return value * is <code>null</code>. **/ + @Override public final Ice.RouterPrx ice_getRouter() { @@ -1970,6 +2072,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param router The router for the new proxy. * @return The new proxy with the specified router. **/ + @Override public final ObjectPrx ice_router(Ice.RouterPrx router) { @@ -1989,6 +2092,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * * @return The locator for this proxy. If no locator is configured, the return value is <code>null</code>. **/ + @Override public final Ice.LocatorPrx ice_getLocator() { @@ -2002,6 +2106,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param The locator for the new proxy. * @return The new proxy with the specified locator. **/ + @Override public final ObjectPrx ice_locator(Ice.LocatorPrx locator) { @@ -2021,6 +2126,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * * @return <code>true</code> if the proxy uses collocation optimization; <code>false</code>, otherwise. **/ + @Override public final boolean ice_isCollocationOptimized() { @@ -2033,6 +2139,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param b <code>true</code> if the new proxy enables collocation optimization; <code>false</code>, otherwise. * @return The new proxy the specified collocation optimization. **/ + @Override public final ObjectPrx ice_collocationOptimized(boolean b) { @@ -2051,6 +2158,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * * @return A new proxy that uses twoway invocations. **/ + @Override public final ObjectPrx ice_twoway() { @@ -2068,6 +2176,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * Returns whether this proxy uses twoway invocations. * @return <code>true</code> if this proxy uses twoway invocations; <code>false</code>, otherwise. **/ + @Override public final boolean ice_isTwoway() { @@ -2079,6 +2188,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * * @return A new proxy that uses oneway invocations. **/ + @Override public final ObjectPrx ice_oneway() { @@ -2096,6 +2206,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * Returns whether this proxy uses oneway invocations. * @return <code>true</code> if this proxy uses oneway invocations; <code>false</code>, otherwise. **/ + @Override public final boolean ice_isOneway() { @@ -2107,6 +2218,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * * @return A new proxy that uses batch oneway invocations. **/ + @Override public final ObjectPrx ice_batchOneway() { @@ -2124,6 +2236,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * Returns whether this proxy uses batch oneway invocations. * @return <code>true</code> if this proxy uses batch oneway invocations; <code>false</code>, otherwise. **/ + @Override public final boolean ice_isBatchOneway() { @@ -2135,6 +2248,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * * @return A new proxy that uses datagram invocations. **/ + @Override public final ObjectPrx ice_datagram() { @@ -2152,6 +2266,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * Returns whether this proxy uses datagram invocations. * @return <code>true</code> if this proxy uses datagram invocations; <code>false</code>, otherwise. **/ + @Override public final boolean ice_isDatagram() { @@ -2163,6 +2278,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * * @return A new proxy that uses batch datagram invocations. **/ + @Override public final ObjectPrx ice_batchDatagram() { @@ -2180,6 +2296,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * Returns whether this proxy uses batch datagram invocations. * @return <code>true</code> if this proxy uses batch datagram invocations; <code>false</code>, otherwise. **/ + @Override public final boolean ice_isBatchDatagram() { @@ -2192,6 +2309,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param co <code>true</code> enables compression for the new proxy; <code>false</code>disables compression. * @return A new proxy with the specified compression setting. **/ + @Override public final ObjectPrx ice_compress(boolean co) { @@ -2212,6 +2330,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param t The timeout for the new proxy in milliseconds. * @return A new proxy with the specified timeout. **/ + @Override public final ObjectPrx ice_timeout(int t) { @@ -2234,6 +2353,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * * @return A new proxy with the specified connection ID. **/ + @Override public final ObjectPrx ice_connectionId(String id) { @@ -2258,6 +2378,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * * @see Connection **/ + @Override public final Connection ice_getConnection() { @@ -2325,6 +2446,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * * @see Connection **/ + @Override public final Connection ice_getCachedConnection() { @@ -2350,6 +2472,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable /** * Flushes any pending batched requests for this communicator. The call blocks until the flush is complete. **/ + @Override public void ice_flushBatchRequests() { @@ -2364,6 +2487,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @return <code>true</code> if the requests were flushed immediately without blocking; <code>false</code> * if the requests could not be flushed immediately. **/ + @Override public boolean ice_flushBatchRequests_async(AMI_Object_ice_flushBatchRequests cb) { @@ -2376,6 +2500,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * * @return The asynchronous result object. **/ + @Override public AsyncResult begin_ice_flushBatchRequests() { @@ -2389,6 +2514,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __cb The callback object to notify the application when the flush is complete. * @return The asynchronous result object. **/ + @Override public AsyncResult begin_ice_flushBatchRequests(Callback __cb) { @@ -2402,13 +2528,14 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __cb The callback object to notify the application when the flush is complete. * @return The asynchronous result object. **/ + @Override public AsyncResult begin_ice_flushBatchRequests(Callback_Object_ice_flushBatchRequests __cb) { AsyncResult result = begin_ice_flushBatchRequestsInternal(__cb); return result; } - + /** * Asynchronously flushes any pending batched requests for this communicator. The call does not block. * @@ -2417,6 +2544,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param __sentCb The callback object to notify the application when the flush is complete. * @return The asynchronous result object. **/ + @Override public AsyncResult begin_ice_flushBatchRequests(IceInternal.Functional_VoidCallback __responseCb, IceInternal.Functional_GenericCallback1<Ice.Exception> __exceptionCb, @@ -2444,6 +2572,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable return __result; } + @Override public void end_ice_flushBatchRequests(AsyncResult __result) { @@ -2458,6 +2587,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable * @param r The object to compare this proxy with. * @return <code>true</code> if this proxy is equal to <code>r</code>; <code>false</code>, otherwise. **/ + @Override public final boolean equals(java.lang.Object r) { @@ -2492,7 +2622,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable } public final int - __handleException(Exception ex, IceInternal.RequestHandler handler, OperationMode mode, boolean sent, + __handleException(Exception ex, IceInternal.RequestHandler handler, OperationMode mode, boolean sent, Ice.IntHolder interval, int cnt) { __setRequestHandler(handler, null); // Clear the request handler @@ -2509,7 +2639,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable // "at-most-once" (see the implementation of the checkRetryAfterException method // of the ProxyFactory class for the reasons why it can be useful). // - // If the request didn't get sent or if it's non-mutating or idempotent it can + // If the request didn't get sent or if it's non-mutating or idempotent it can // also always be retried if the retry count isn't reached. // if(ex instanceof LocalException && (!sent || @@ -2592,7 +2722,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable __og.readEmptyParams(); } } - + public final void __end(AsyncResult __result, String operation) { @@ -2627,7 +2757,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable return _requestHandler; } // async = true to avoid blocking with the proxy mutex locked. - _requestHandler = createRequestHandler(true); + _requestHandler = createRequestHandler(true); return _requestHandler; } } @@ -2716,7 +2846,7 @@ public class ObjectPrxHelperBase implements ObjectPrx, java.io.Serializable { try { - ObjectPrxHelperBase proxy = (ObjectPrxHelperBase)getClass().newInstance(); + ObjectPrxHelperBase proxy = getClass().newInstance(); proxy.__setup(ref); return proxy; } diff --git a/java/src/Ice/ObjectReader.java b/java/src/Ice/ObjectReader.java index bb39e8f0100..9ccecd38446 100644 --- a/java/src/Ice/ObjectReader.java +++ b/java/src/Ice/ObjectReader.java @@ -25,12 +25,14 @@ public abstract class ObjectReader extends ObjectImpl **/ public abstract void read(InputStream in); + @Override public void __write(IceInternal.BasicStream os) { assert(false); } + @Override public void __read(IceInternal.BasicStream is) { diff --git a/java/src/Ice/ObjectWriter.java b/java/src/Ice/ObjectWriter.java index 07ae3f60d2e..4ae8a087075 100644 --- a/java/src/Ice/ObjectWriter.java +++ b/java/src/Ice/ObjectWriter.java @@ -21,6 +21,7 @@ public abstract class ObjectWriter extends ObjectImpl **/ public abstract void write(OutputStream out); + @Override public void __write(IceInternal.BasicStream os) { diff --git a/java/src/Ice/OnewayCallback.java b/java/src/Ice/OnewayCallback.java index c5cd16592a4..f7403e60526 100644 --- a/java/src/Ice/OnewayCallback.java +++ b/java/src/Ice/OnewayCallback.java @@ -32,7 +32,7 @@ public abstract class OnewayCallback extends IceInternal.CallbackBase * @param ex The Ice system exception raised by the operation. **/ public void exception(SystemException ex) - { + { exception(new Ice.UnknownException(ex)); } @@ -43,11 +43,13 @@ public abstract class OnewayCallback extends IceInternal.CallbackBase { } + @Override public final void __sent(AsyncResult __result) { sent(__result.sentSynchronously()); } + @Override public final void __completed(AsyncResult __result) { try diff --git a/java/src/Ice/OptionalObject.java b/java/src/Ice/OptionalObject.java index 5a692b6562b..04f85f40584 100644 --- a/java/src/Ice/OptionalObject.java +++ b/java/src/Ice/OptionalObject.java @@ -34,6 +34,7 @@ public class OptionalObject implements ReadObjectCallback, IceInternal.Patcher * * @param v The new object for the optional. **/ + @Override @SuppressWarnings("unchecked") public void patch(Ice.Object v) @@ -57,6 +58,7 @@ public class OptionalObject implements ReadObjectCallback, IceInternal.Patcher * * @return The Slice type ID. **/ + @Override public String type() { @@ -68,6 +70,7 @@ public class OptionalObject implements ReadObjectCallback, IceInternal.Patcher * * @param obj The new object for the optional. **/ + @Override public void invoke(Ice.Object obj) { diff --git a/java/src/Ice/OutputStreamI.java b/java/src/Ice/OutputStreamI.java index 98395099ff7..a5f248b64ac 100644 --- a/java/src/Ice/OutputStreamI.java +++ b/java/src/Ice/OutputStreamI.java @@ -37,114 +37,133 @@ public class OutputStreamI implements OutputStream _os.closure(this); } + @Override public Communicator communicator() { return _communicator; } + @Override public void writeBool(boolean v) { _os.writeBool(v); } + @Override public void writeBoolSeq(boolean[] v) { _os.writeBoolSeq(v); } + @Override public void writeByte(byte v) { _os.writeByte(v); } + @Override public void writeByteSeq(byte[] v) { _os.writeByteSeq(v); } + @Override public void writeSerializable(java.io.Serializable v) { _os.writeSerializable(v); } + @Override public void writeShort(short v) { _os.writeShort(v); } + @Override public void writeShortSeq(short[] v) { _os.writeShortSeq(v); } + @Override public void writeInt(int v) { _os.writeInt(v); } + @Override public void writeIntSeq(int[] v) { _os.writeIntSeq(v); } + @Override public void writeLong(long v) { _os.writeLong(v); } + @Override public void writeLongSeq(long[] v) { _os.writeLongSeq(v); } + @Override public void writeFloat(float v) { _os.writeFloat(v); } + @Override public void writeFloatSeq(float[] v) { _os.writeFloatSeq(v); } + @Override public void writeDouble(double v) { _os.writeDouble(v); } + @Override public void writeDoubleSeq(double[] v) { _os.writeDoubleSeq(v); } + @Override public void writeString(String v) { _os.writeString(v); } + @Override public void writeStringSeq(String[] v) { _os.writeStringSeq(v); } + @Override public void writeSize(int sz) { @@ -156,126 +175,147 @@ public class OutputStreamI implements OutputStream _os.writeSize(sz); } + @Override public void writeProxy(ObjectPrx v) { _os.writeProxy(v); } + @Override public void writeObject(Ice.Object v) { _os.writeObject(v); } + @Override public void writeEnum(int v, int maxValue) { _os.writeEnum(v, maxValue); } + @Override public void writeException(UserException v) { _os.writeUserException(v); } + @Override public void startObject(SlicedData slicedData) { _os.startWriteObject(slicedData); } + @Override public void endObject() { _os.endWriteObject(); } + @Override public void startException(SlicedData slicedData) { _os.startWriteException(slicedData); } + @Override public void endException() { _os.endWriteException(); } + @Override public void startSlice(String typeId, int compactId, boolean last) { _os.startWriteSlice(typeId, compactId, last); } + @Override public void endSlice() { _os.endWriteSlice(); } + @Override public void startEncapsulation(Ice.EncodingVersion encoding, Ice.FormatType format) { _os.startWriteEncaps(encoding, format); } + @Override public void startEncapsulation() { _os.startWriteEncaps(); } + @Override public void endEncapsulation() { _os.endWriteEncapsChecked(); } + @Override public EncodingVersion getEncoding() { return _os.getWriteEncoding(); } + @Override public void writePendingObjects() { _os.writePendingObjects(); } + @Override public boolean writeOptional(int tag, Ice.OptionalFormat format) { return _os.writeOpt(tag, format); } + @Override public int pos() { return _os.pos(); } + @Override public void rewrite(int sz, int pos) { _os.rewriteInt(sz, pos); } + @Override public int startSize() { return _os.startSize(); } + @Override public void endSize(int pos) { _os.endSize(pos); } + @Override public byte[] finished() { @@ -286,6 +326,7 @@ public class OutputStreamI implements OutputStream return result; } + @Override public void reset(boolean clearBuffer) { @@ -303,6 +344,7 @@ public class OutputStreamI implements OutputStream buf.b.position(0); } + @Override public void destroy() { diff --git a/java/src/Ice/PluginManagerI.java b/java/src/Ice/PluginManagerI.java index 73ce78a1fe2..96cc2c18ae4 100644 --- a/java/src/Ice/PluginManagerI.java +++ b/java/src/Ice/PluginManagerI.java @@ -13,6 +13,7 @@ public final class PluginManagerI implements PluginManager { private static String _kindOfObject = "plugin"; + @Override public synchronized void initializePlugins() { @@ -60,6 +61,7 @@ public final class PluginManagerI implements PluginManager _initialized = true; } + @Override public synchronized String[] getPlugins() { @@ -71,6 +73,7 @@ public final class PluginManagerI implements PluginManager return names.toArray(new String[0]); } + @Override public synchronized Plugin getPlugin(String name) { @@ -91,6 +94,7 @@ public final class PluginManagerI implements PluginManager throw ex; } + @Override public synchronized void addPlugin(String name, Plugin plugin) { @@ -113,6 +117,7 @@ public final class PluginManagerI implements PluginManager _plugins.add(info); } + @Override public synchronized void destroy() { diff --git a/java/src/Ice/PropertiesI.java b/java/src/Ice/PropertiesI.java index 6a6c9ec8ac6..48a005a9838 100644 --- a/java/src/Ice/PropertiesI.java +++ b/java/src/Ice/PropertiesI.java @@ -29,6 +29,7 @@ public final class PropertiesI implements Properties public boolean used; } + @Override public synchronized String getProperty(String key) { @@ -44,6 +45,7 @@ public final class PropertiesI implements Properties } } + @Override public synchronized String getPropertyWithDefault(String key, String value) { @@ -59,12 +61,14 @@ public final class PropertiesI implements Properties } } + @Override public int getPropertyAsInt(String key) { return getPropertyAsIntWithDefault(key, 0); } + @Override public synchronized int getPropertyAsIntWithDefault(String key, int value) { @@ -87,12 +91,14 @@ public final class PropertiesI implements Properties return value; } + @Override public String[] getPropertyAsList(String key) { return getPropertyAsListWithDefault(key, null); } + @Override public synchronized String[] getPropertyAsListWithDefault(String key, String[] value) { @@ -125,6 +131,7 @@ public final class PropertiesI implements Properties } } + @Override public synchronized java.util.Map<String, String> getPropertiesForPrefix(String prefix) { @@ -142,6 +149,7 @@ public final class PropertiesI implements Properties return result; } + @Override public void setProperty(String key, String value) { @@ -249,6 +257,7 @@ public final class PropertiesI implements Properties } } + @Override public synchronized String[] getCommandLineOptions() { @@ -262,6 +271,7 @@ public final class PropertiesI implements Properties return result; } + @Override public String[] parseCommandLineOptions(String pfx, String[] options) { @@ -291,6 +301,7 @@ public final class PropertiesI implements Properties return result.toArray(new String[0]); } + @Override public String[] parseIceCommandLineOptions(String[] options) { @@ -302,6 +313,7 @@ public final class PropertiesI implements Properties return args; } + @Override public void load(String file) { @@ -354,7 +366,7 @@ public final class PropertiesI implements Properties { break; } - + String envKey = line.substring(start + 1, end); String envValue = System.getenv(envKey); if(envValue == null) @@ -434,6 +446,7 @@ public final class PropertiesI implements Properties } } + @Override public synchronized Properties _clone() { @@ -742,7 +755,7 @@ public final class PropertiesI implements Properties { load(file.trim()); } - + _properties.put("Ice.Config", new PropertyValue(value, true)); } } diff --git a/java/src/Ice/ProxyIdentityFacetKey.java b/java/src/Ice/ProxyIdentityFacetKey.java index 0d63da81ff7..fd870eaae73 100644 --- a/java/src/Ice/ProxyIdentityFacetKey.java +++ b/java/src/Ice/ProxyIdentityFacetKey.java @@ -47,6 +47,7 @@ public class ProxyIdentityFacetKey * * @return The hash value. **/ + @Override public int hashCode() { @@ -60,6 +61,7 @@ public class ProxyIdentityFacetKey * @return <code>true</code> if the passed object is a proxy with the same object * identity and facet as this proxy; <code>false</code>, otherwise. **/ + @Override public boolean equals(java.lang.Object obj) { diff --git a/java/src/Ice/ProxyIdentityKey.java b/java/src/Ice/ProxyIdentityKey.java index a404b9627ba..63c4f64a6da 100644 --- a/java/src/Ice/ProxyIdentityKey.java +++ b/java/src/Ice/ProxyIdentityKey.java @@ -45,6 +45,7 @@ public class ProxyIdentityKey * * @return The hash value. **/ + @Override public int hashCode() { @@ -58,6 +59,7 @@ public class ProxyIdentityKey * @return <code>true</code> if the passed object is a proxy with the same object * identity; <code>false</code>, otherwise. **/ + @Override public boolean equals(java.lang.Object obj) { diff --git a/java/src/Ice/Request.java b/java/src/Ice/Request.java index 0cce04cbaf2..6ee6f0b0ccd 100644 --- a/java/src/Ice/Request.java +++ b/java/src/Ice/Request.java @@ -13,7 +13,7 @@ package Ice; * Interface for incoming requests. **/ public interface Request -{ +{ /** * Returns the {@link Current} object for this the request. * diff --git a/java/src/Ice/SysLoggerI.java b/java/src/Ice/SysLoggerI.java index 432949b1e9e..5058f5ff3e1 100644 --- a/java/src/Ice/SysLoggerI.java +++ b/java/src/Ice/SysLoggerI.java @@ -16,7 +16,7 @@ import java.io.IOException; public final class SysLoggerI implements Logger { - public + public SysLoggerI(String ident, String facilityString) { int facility; @@ -107,7 +107,7 @@ public final class SysLoggerI implements Logger initialize(ident, facility); } - private + private SysLoggerI(String ident, int facility) { initialize(ident, facility); @@ -122,7 +122,7 @@ public final class SysLoggerI implements Logger // // Open a datagram socket to communicate with the localhost // syslog daemon. - // + // try { _host = IceInternal.Network.getLocalAddress(IceInternal.Network.EnableBoth); @@ -135,30 +135,35 @@ public final class SysLoggerI implements Logger } } + @Override public void print(String message) { log(LOG_INFO, message); } + @Override public void trace(String category, String message) { log(LOG_INFO, category + ": " + message); } + @Override public void warning(String message) { log(LOG_WARNING, message); } + @Override public void error(String message) { log(LOG_ERR, message); } + @Override public Logger cloneWithPrefix(String prefix) { @@ -168,7 +173,7 @@ public final class SysLoggerI implements Logger private void log(int severity, String message) { - try + try { // // Create a syslog message as defined by the RFC 3164: @@ -185,7 +190,7 @@ public final class SysLoggerI implements Logger byte buf[] = msg.getBytes(); DatagramPacket p = new DatagramPacket(buf, buf.length, _host, _port); _socket.send(p); - } + } catch(IOException ex) { throw new Ice.SocketException(ex); @@ -200,7 +205,7 @@ public final class SysLoggerI implements Logger // // Syslog facilities (as defined in syslog.h) - // + // private final static int LOG_KERN = 0; private final static int LOG_USER = 1; private final static int LOG_MAIL = 2; @@ -224,7 +229,7 @@ public final class SysLoggerI implements Logger // // Syslog priorities (as defined in syslog.h) - // + // private final static int LOG_ERR = 3; private final static int LOG_WARNING = 4; private final static int LOG_INFO = 6; diff --git a/java/src/Ice/ThreadHookPlugin.java b/java/src/Ice/ThreadHookPlugin.java index 85f8aa10462..d50ca5e7440 100644 --- a/java/src/Ice/ThreadHookPlugin.java +++ b/java/src/Ice/ThreadHookPlugin.java @@ -26,7 +26,7 @@ public class ThreadHookPlugin implements Ice.Plugin * @param communicator The communicator using the thread notification hook. * @param threadHook The thread notification hook for the communicator. **/ - public + public ThreadHookPlugin(Communicator communicator, ThreadNotification threadHook) { if(communicator == null) @@ -45,7 +45,8 @@ public class ThreadHookPlugin implements Ice.Plugin * can override this method to perform any initialization that might be required * by a custom thread notification hook. **/ - public void + @Override + public void initialize() { } @@ -55,6 +56,7 @@ public class ThreadHookPlugin implements Ice.Plugin * can override this method to perform any finalization that might be required * by a custom thread notification hook. **/ + @Override public void destroy() { diff --git a/java/src/Ice/TwowayCallbackVoidUE.java b/java/src/Ice/TwowayCallbackVoidUE.java index 32ee25a9d86..7bcbf69b5ad 100644 --- a/java/src/Ice/TwowayCallbackVoidUE.java +++ b/java/src/Ice/TwowayCallbackVoidUE.java @@ -15,7 +15,7 @@ public interface TwowayCallbackVoidUE extends TwowayCallback * Called when the invocation response is received. **/ void response(); - + /** * Called when the invocation raises an user exception. * diff --git a/java/src/Ice/UnknownSlicedObject.java b/java/src/Ice/UnknownSlicedObject.java index b0d697b2fb2..0e75ab9ae6b 100644 --- a/java/src/Ice/UnknownSlicedObject.java +++ b/java/src/Ice/UnknownSlicedObject.java @@ -36,6 +36,7 @@ public final class UnknownSlicedObject extends ObjectImpl return _unknownTypeId; } + @Override public void __write(IceInternal.BasicStream __os) { @@ -43,6 +44,7 @@ public final class UnknownSlicedObject extends ObjectImpl __os.endWriteObject(); } + @Override public void __read(IceInternal.BasicStream __is) { diff --git a/java/src/Ice/UserException.java b/java/src/Ice/UserException.java index a46767287ef..bb32af0e28c 100644 --- a/java/src/Ice/UserException.java +++ b/java/src/Ice/UserException.java @@ -28,6 +28,7 @@ public abstract class UserException extends java.lang.Exception implements Clone * * @return The copy of this exception. **/ + @Override public java.lang.Object clone() { java.lang.Object o = null; @@ -55,6 +56,7 @@ public abstract class UserException extends java.lang.Exception implements Clone * * @return A string representation of this exception. **/ + @Override public String toString() { diff --git a/java/src/Ice/UserExceptionReader.java b/java/src/Ice/UserExceptionReader.java index ecbb87e345a..8ffc897ae1d 100644 --- a/java/src/Ice/UserExceptionReader.java +++ b/java/src/Ice/UserExceptionReader.java @@ -32,11 +32,13 @@ public abstract class UserExceptionReader extends UserException **/ public abstract void read(Ice.InputStream is); + @Override public void __write(IceInternal.BasicStream os) { assert(false); } + @Override public void __read(IceInternal.BasicStream is) { InputStream stream = (InputStream)is.closure(); @@ -44,11 +46,13 @@ public abstract class UserExceptionReader extends UserException read(stream); } + @Override public void __write(Ice.OutputStream os) { assert(false); } + @Override public void __read(Ice.InputStream is) { read(is); diff --git a/java/src/Ice/UserExceptionWriter.java b/java/src/Ice/UserExceptionWriter.java index 6db541ea97e..841d4513449 100644 --- a/java/src/Ice/UserExceptionWriter.java +++ b/java/src/Ice/UserExceptionWriter.java @@ -33,6 +33,7 @@ public abstract class UserExceptionWriter extends UserException public abstract void write(Ice.OutputStream os); + @Override public void __write(IceInternal.BasicStream os) { @@ -50,6 +51,7 @@ public abstract class UserExceptionWriter extends UserException assert(false); } + @Override public void __write(Ice.OutputStream os) { diff --git a/java/src/Ice/Util.java b/java/src/Ice/Util.java index 36c96fd8b79..ece779d6e06 100644 --- a/java/src/Ice/Util.java +++ b/java/src/Ice/Util.java @@ -246,7 +246,7 @@ public final class Util { escapes++; } - + // // We ignore escaped escapes // @@ -420,7 +420,7 @@ public final class Util { return n; } - + String lhsFacet = lhs.ice_getFacet(); String rhsFacet = rhs.ice_getFacet(); if(lhsFacet == null && rhsFacet == null) @@ -624,7 +624,7 @@ public final class Util * * @return The converted string. **/ - static public String + static public String protocolVersionToString(Ice.ProtocolVersion v) { return majorMinorToString(v.major, v.minor); @@ -637,7 +637,7 @@ public final class Util * * @return The converted string. **/ - static public String + static public String encodingVersionToString(Ice.EncodingVersion v) { return majorMinorToString(v.major, v.minor); @@ -653,19 +653,19 @@ public final class Util { return (Ice.ProtocolVersion)IceInternal.Protocol.currentProtocol.clone(); } - + /** * Returns the supported Ice encoding version. * * @return The Ice encoding version. **/ static public Ice.EncodingVersion - currentEncoding() + currentEncoding() { return (Ice.EncodingVersion)IceInternal.Protocol.currentEncoding.clone(); } - static private byte + static private byte stringToMajor(String str) { int pos = str.indexOf('.'); @@ -673,7 +673,7 @@ public final class Util { throw new Ice.VersionParseException("malformed version value `" + str + "'"); } - + String majStr = str.substring(0, pos); int majVersion; try @@ -684,7 +684,7 @@ public final class Util { throw new Ice.VersionParseException("invalid version value `" + str + "'"); } - + if(majVersion < 1 || majVersion > 255) { throw new Ice.VersionParseException("range error in version `" + str + "'"); @@ -701,7 +701,7 @@ public final class Util { throw new Ice.VersionParseException("malformed version value `" + str + "'"); } - + String minStr = str.substring(pos + 1, str.length()); int minVersion; try @@ -712,7 +712,7 @@ public final class Util { throw new Ice.VersionParseException("invalid version value `" + str + "'"); } - + if(minVersion < 0 || minVersion > 255) { throw new Ice.VersionParseException("range error in version `" + str + "'"); @@ -721,13 +721,13 @@ public final class Util return (byte)minVersion; } - static private String + static private String majorMinorToString(byte major, byte minor) { StringBuilder str = new StringBuilder(); - str.append(major < 0 ? (int)major + 255 : (int)major); + str.append(major < 0 ? major + 255 : (int)major); str.append("."); - str.append(minor < 0 ? (int)minor + 255 : (int)minor); + str.append(minor < 0 ? minor + 255 : (int)minor); return str.toString(); } diff --git a/java/src/Ice/_AMD_Object_ice_invoke.java b/java/src/Ice/_AMD_Object_ice_invoke.java index 8a835f25d0e..5e4e160eff7 100644 --- a/java/src/Ice/_AMD_Object_ice_invoke.java +++ b/java/src/Ice/_AMD_Object_ice_invoke.java @@ -17,6 +17,7 @@ final class _AMD_Object_ice_invoke extends IceInternal.IncomingAsync implements super(in); } + @Override public void ice_response(boolean ok, byte[] outEncaps) { diff --git a/java/src/IceInternal/ACMConfig.java b/java/src/IceInternal/ACMConfig.java index 466e6728b9b..f7dcf5653cb 100644 --- a/java/src/IceInternal/ACMConfig.java +++ b/java/src/IceInternal/ACMConfig.java @@ -32,7 +32,7 @@ public final class ACMConfig implements java.lang.Cloneable { timeoutProperty = prefix + ".Timeout"; }; - + timeout = p.getPropertyAsIntWithDefault(timeoutProperty, dflt.timeout / 1000) * 1000; // To milliseconds int hb = p.getPropertyAsIntWithDefault(prefix + ".Heartbeat", dflt.heartbeat.ordinal()); @@ -60,6 +60,7 @@ public final class ACMConfig implements java.lang.Cloneable } } + @Override public java.lang.Object clone() { diff --git a/java/src/IceInternal/ACMMonitor.java b/java/src/IceInternal/ACMMonitor.java index 303bc8ded38..5d592e62b22 100644 --- a/java/src/IceInternal/ACMMonitor.java +++ b/java/src/IceInternal/ACMMonitor.java @@ -14,7 +14,7 @@ public interface ACMMonitor extends Runnable void add(Ice.ConnectionI con); void remove(Ice.ConnectionI con); void reap(Ice.ConnectionI con); - + ACMMonitor acm(Ice.IntOptional timeout, Ice.Optional<Ice.ACMClose> close, Ice.Optional<Ice.ACMHeartbeat> heartbeat); Ice.ACM getACM(); }; diff --git a/java/src/IceInternal/Acceptor.java b/java/src/IceInternal/Acceptor.java index 0d883d6ef8b..d5910130fa2 100644 --- a/java/src/IceInternal/Acceptor.java +++ b/java/src/IceInternal/Acceptor.java @@ -16,5 +16,6 @@ public interface Acceptor void listen(); Transceiver accept(); String protocol(); + @Override String toString(); } diff --git a/java/src/IceInternal/BasicStream.java b/java/src/IceInternal/BasicStream.java index 7fc605228ca..8d8a999e5af 100644 --- a/java/src/IceInternal/BasicStream.java +++ b/java/src/IceInternal/BasicStream.java @@ -407,7 +407,7 @@ public class BasicStream { throw new Ice.EncapsulationException(); } - + // // Ice version < 3.3 had a bug where user exceptions with // class members could be encoded with a trailing byte @@ -606,7 +606,7 @@ public class BasicStream // If using the 1.0 encoding and no objects were written, we // still write an empty sequence for pending objects if // requested (i.e.: if this is called). - // + // // This is required by the 1.0 encoding, even if no objects // are written we do marshal an empty sequence if marshaled // data types use classes. @@ -648,7 +648,7 @@ public class BasicStream } else { - return (int)(b < 0 ? b + 256 : b); + return b < 0 ? b + 256 : b; } } catch(java.nio.BufferUnderflowException ex) @@ -712,7 +712,7 @@ public class BasicStream { int pos = _buf.b.position(); writeInt(0); // Placeholder for 32-bit size - return pos; + return pos; } public void @@ -2094,7 +2094,7 @@ public class BasicStream } final byte b = readByte(); - final int v = b < 0 ? (int)b + 256 : b; + final int v = b < 0 ? b + 256 : b; if(v == OPTIONAL_END_MARKER) { _buf.b.position(_buf.b.position() - 1); // Rewind. @@ -2214,7 +2214,7 @@ public class BasicStream } final byte b = readByte(); - final int v = b < 0 ? (int)b + 256 : b; + final int v = b < 0 ? b + 256 : b; if(v == OPTIONAL_END_MARKER) { return; @@ -2280,18 +2280,21 @@ public class BasicStream _data = data; } + @Override public void close() throws java.io.IOException { } + @Override public void flush() throws java.io.IOException { } + @Override public void write(byte[] b) throws java.io.IOException @@ -2301,6 +2304,7 @@ public class BasicStream _pos += b.length; } + @Override public void write(byte[] b, int off, int len) throws java.io.IOException @@ -2310,6 +2314,7 @@ public class BasicStream _pos += len; } + @Override public void write(int b) throws java.io.IOException @@ -2371,8 +2376,8 @@ public class BasicStream // For interoperability with the bzip2 C library, we insert the magic bytes // 'B', 'Z' before invoking the Java implementation. // - bos.write((int)'B'); - bos.write((int)'Z'); + bos.write('B'); + bos.write('Z'); java.lang.Object[] args = new java.lang.Object[]{ bos, Integer.valueOf(compressionLevel) }; java.io.OutputStream os = (java.io.OutputStream)_bzOutputStreamCtor.newInstance(args); os.write(data, offset + headerSize, uncompressedLen); @@ -2533,7 +2538,7 @@ public class BasicStream return obj; } - private String + private String getTypeId(int compactId) { String className = "IceCompactId.TypeId_" + Integer.toString(compactId); @@ -2746,25 +2751,25 @@ public class BasicStream abstract void readObject(Patcher patcher); abstract void throwException(UserExceptionFactory factory) throws Ice.UserException; - + abstract void startInstance(SliceType type); abstract Ice.SlicedData endInstance(boolean preserve); abstract String startSlice(); abstract void endSlice(); abstract void skipSlice(); - - boolean + + boolean readOpt(int tag, Ice.OptionalFormat format) { return false; } - void + void readPendingObjects() { } - protected String + protected String readTypeId(boolean isIndex) { if(_typeIdMap == null) // Lazy initialization @@ -2802,7 +2807,7 @@ public class BasicStream { v = userFactory.create(typeId); } - + // // If that fails, invoke the default factory if one has been // registered. @@ -2815,7 +2820,7 @@ public class BasicStream v = userFactory.create(typeId); } } - + // // Last chance: try to instantiate the class dynamically. // @@ -2870,7 +2875,7 @@ public class BasicStream l.add(patcher); } - protected void + protected void unmarshal(int index, Ice.Object v) { // @@ -2893,7 +2898,7 @@ public class BasicStream if(l != null) { assert(l.size() > 0); - + // // Patch all pointers that refer to the instance. // @@ -2901,7 +2906,7 @@ public class BasicStream { p.patch(v); } - + // // Clear out the patch map for that index -- there is nothing left // to patch for that index for the time being. @@ -2909,7 +2914,7 @@ public class BasicStream _patchMap.remove(index); } } - + if((_patchMap == null || _patchMap.isEmpty()) && _objectList == null) { try @@ -2929,7 +2934,7 @@ public class BasicStream _objectList = new java.util.ArrayList<Ice.Object>(); } _objectList.add(v); - + if(_patchMap == null || _patchMap.isEmpty()) { // @@ -2978,10 +2983,11 @@ public class BasicStream _sliceType = SliceType.NoSlice; } + @Override void readObject(Patcher patcher) { assert(patcher != null); - + // // Object references are encoded as a negative integer in 1.0. // @@ -3002,6 +3008,7 @@ public class BasicStream } } + @Override void throwException(UserExceptionFactory factory) throws Ice.UserException { @@ -3087,12 +3094,14 @@ public class BasicStream } } + @Override void startInstance(SliceType sliceType) { assert(_sliceType == sliceType); _skipFirstSlice = true; } + @Override Ice.SlicedData endInstance(boolean preserve) { // @@ -3113,6 +3122,7 @@ public class BasicStream return null; } + @Override String startSlice() { // @@ -3128,7 +3138,7 @@ public class BasicStream // // For objects, first read the type ID boolean which indicates // whether or not the type ID is encoded as a string or as an - // index. For exceptions, the type ID is always encoded as a + // index. For exceptions, the type ID is always encoded as a // string. // if(_sliceType == SliceType.ObjectSlice) // For exceptions, the type ID is always encoded as a string @@ -3150,10 +3160,12 @@ public class BasicStream return _typeId; } + @Override void endSlice() { } + @Override void skipSlice() { if(_stream.instance().traceLevels().slicing > 0) @@ -3173,6 +3185,7 @@ public class BasicStream _stream.skip(_sliceSize - 4); } + @Override void readPendingObjects() { int num; @@ -3274,6 +3287,7 @@ public class BasicStream _current = null; } + @Override void readObject(Patcher patcher) { int index = _stream.readSize(); @@ -3319,6 +3333,7 @@ public class BasicStream } } + @Override void throwException(UserExceptionFactory factory) throws Ice.UserException { @@ -3387,12 +3402,14 @@ public class BasicStream } } + @Override void startInstance(SliceType sliceType) { assert(_current.sliceType == sliceType); _current.skipFirstSlice = true; } + @Override Ice.SlicedData endInstance(boolean preserve) { Ice.SlicedData slicedData = null; @@ -3409,6 +3426,7 @@ public class BasicStream return slicedData; } + @Override String startSlice() { // @@ -3472,6 +3490,7 @@ public class BasicStream return _current.typeId; } + @Override void endSlice() { if((_current.sliceFlags & FLAG_HAS_OPTIONAL_MEMBERS) != 0) @@ -3492,8 +3511,8 @@ public class BasicStream for(int i = 0; i < indirectionTable.length; ++i) { indirectionTable[i] = readInstance(_stream.readSize(), null); - } - + } + // // Sanity checks. If there are optional members, it's possible // that not all object references were read if they are from @@ -3528,6 +3547,7 @@ public class BasicStream } } + @Override void skipSlice() { if(_stream.instance().traceLevels().slicing > 0) @@ -3556,7 +3576,7 @@ public class BasicStream if(_current.sliceType == SliceType.ObjectSlice) { throw new Ice.NoObjectFactoryException( - "compact format prevents slicing (the sender should use the sliced format instead)", + "compact format prevents slicing (the sender should use the sliced format instead)", _current.typeId); } else @@ -3617,7 +3637,7 @@ public class BasicStream for(int i = 0; i < indirectionTable.length; ++i) { indirectionTable[i] = readInstance(_stream.readSize(), null); - } + } _current.indirectionTables.add(indirectionTable); } else @@ -3628,6 +3648,7 @@ public class BasicStream _current.slices.add(info); } + @Override boolean readOpt(int readTag, Ice.OptionalFormat expectedFormat) { if(_current == null) @@ -3644,7 +3665,7 @@ public class BasicStream private int readInstance(int index, Patcher patcher) { assert(index > 0); - + if(index > 1) { if(patcher != null) @@ -3690,7 +3711,7 @@ public class BasicStream } catch(Throwable ex) { - throw new Ice.MarshalException("exception in CompactIdResolver for ID " + + throw new Ice.MarshalException("exception in CompactIdResolver for ID " + _current.compactId, ex); } } @@ -3699,11 +3720,11 @@ public class BasicStream _current.typeId = _stream.getTypeId(_current.compactId); } } - + if(_current.typeId.length() > 0) { v = newInstance(_current.typeId); - + // // We found a factory, we get out of this loop. // @@ -3795,7 +3816,7 @@ public class BasicStream info.objects = new Ice.Object[table != null ? table.length : 0]; for(int j = 0; j < info.objects.length; ++j) { - addPatchEntry(table[j], new SequencePatcher(info.objects, Ice.Object.class, + addPatchEntry(table[j], new SequencePatcher(info.objects, Ice.Object.class, Ice.ObjectImpl.ice_staticId(), j)); } } @@ -3867,10 +3888,10 @@ public class BasicStream _typeIdIndex = 0; _marshaledMap = new java.util.IdentityHashMap<Ice.Object, Integer>(); } - + abstract void writeObject(Ice.Object v); abstract void writeUserException(Ice.UserException v); - + abstract void startInstance(SliceType type, Ice.SlicedData data); abstract void endInstance(); abstract void startSlice(String typeId, int compactId, boolean last); @@ -3909,7 +3930,7 @@ public class BasicStream // Encapsulation attributes for object marshalling. final protected java.util.IdentityHashMap<Ice.Object, Integer> _marshaledMap; - + // Encapsulation attributes for object marshalling. private java.util.TreeMap<String, Integer> _typeIdMap; private int _typeIdIndex; @@ -3925,6 +3946,7 @@ public class BasicStream _toBeMarshaledMap = new java.util.IdentityHashMap<Ice.Object, Integer>(); } + @Override void writeObject(Ice.Object v) { // @@ -3940,12 +3962,13 @@ public class BasicStream } } + @Override void writeUserException(Ice.UserException v) { // // User exception with the 1.0 encoding start with a boolean // flag that indicates whether or not the exception uses - // classes. + // classes. // // This allows reading the pending objects even if some part of // the exception was sliced. @@ -3958,12 +3981,14 @@ public class BasicStream writePendingObjects(); } } - + + @Override void startInstance(SliceType sliceType, Ice.SlicedData sliceData) { _sliceType = sliceType; } + @Override void endInstance() { if(_sliceType == SliceType.ObjectSlice) @@ -3978,6 +4003,7 @@ public class BasicStream _sliceType = SliceType.NoSlice; } + @Override void startSlice(String typeId, int compactId, boolean last) { // @@ -4009,6 +4035,7 @@ public class BasicStream _writeSlice = _stream.pos(); } + @Override void endSlice() { // @@ -4018,6 +4045,7 @@ public class BasicStream _stream.rewriteInt(sz, _writeSlice - 4); } + @Override void writePendingObjects() { while(_toBeMarshaledMap.size() > 0) @@ -4103,11 +4131,12 @@ public class BasicStream { EncapsEncoder11(BasicStream stream, WriteEncaps encaps) { - super(stream, encaps); + super(stream, encaps); _current = null; _objectIdIndex = 1; } + @Override void writeObject(Ice.Object v) { if(v == null) @@ -4128,14 +4157,14 @@ public class BasicStream // table. The indirect object table is encoded at the end of // each slice and is always read (even if the Slice is // unknown). - // + // Integer index = _current.indirectionMap.get(v); if(index == null) { _current.indirectionTable.add(v); final int idx = _current.indirectionTable.size(); // Position + 1 (0 is reserved for nil) _current.indirectionMap.put(v, idx); - _stream.writeSize(idx); + _stream.writeSize(idx); } else { @@ -4148,11 +4177,13 @@ public class BasicStream } } + @Override void writeUserException(Ice.UserException v) { v.__write(_stream); } + @Override void startInstance(SliceType sliceType, Ice.SlicedData data) { if(_current == null) @@ -4172,14 +4203,16 @@ public class BasicStream } } + @Override void endInstance() { _current = _current.previous; - } + } + @Override void startSlice(String typeId, int compactId, boolean last) { - assert((_current.indirectionTable == null || _current.indirectionTable.isEmpty()) && + assert((_current.indirectionTable == null || _current.indirectionTable.isEmpty()) && (_current.indirectionMap == null || _current.indirectionMap.isEmpty())); _current.sliceFlagsPos = _stream.pos(); @@ -4206,7 +4239,7 @@ public class BasicStream // // Encode the type ID (only in the first slice for the compact // encoding). - // + // if(_encaps.format == Ice.FormatType.SlicedFormat || _current.firstSlice) { if(compactId >= 0) @@ -4244,6 +4277,7 @@ public class BasicStream _current.firstSlice = false; } + @Override void endSlice() { // @@ -4290,7 +4324,8 @@ public class BasicStream // _stream.rewriteByte(_current.sliceFlags, _current.sliceFlagsPos); } - + + @Override boolean writeOpt(int tag, Ice.OptionalFormat format) { if(_current == null) @@ -4314,7 +4349,7 @@ public class BasicStream private void writeSlicedData(Ice.SlicedData slicedData) { assert(slicedData != null); - + // // We only remarshal preserved slices if we are using the sliced // format. Otherwise, we ignore the preserved slices, which @@ -4329,12 +4364,12 @@ public class BasicStream for(Ice.SliceInfo info : slicedData.slices) { startSlice(info.typeId, info.compactId, info.isLastSlice); - + // // Write the bytes associated with this slice. // _stream.writeBlob(info.bytes); - + if(info.hasOptionalMembers) { _current.sliceFlags |= FLAG_HAS_OPTIONAL_MEMBERS; @@ -4392,7 +4427,7 @@ public class BasicStream _stream.writeSize(1); // Object instance marker. v.__write(_stream); - } + } private static final class InstanceData { diff --git a/java/src/IceInternal/BatchOutgoing.java b/java/src/IceInternal/BatchOutgoing.java index acee3cdd6de..a3294769e56 100644 --- a/java/src/IceInternal/BatchOutgoing.java +++ b/java/src/IceInternal/BatchOutgoing.java @@ -112,7 +112,7 @@ public final class BatchOutgoing implements OutgoingMessageCallback } } } - + if(timedOut) { handler.requestTimedOut(this); @@ -144,7 +144,7 @@ public final class BatchOutgoing implements OutgoingMessageCallback // isn't useful, there were no batch requests associated with // the proxy's request handler. // - _proxy.__setRequestHandler(handler, null); + _proxy.__setRequestHandler(handler, null); } catch(Ice.Exception ex) { @@ -157,18 +157,21 @@ public final class BatchOutgoing implements OutgoingMessageCallback } } + @Override public boolean send(Ice.ConnectionI connection, boolean compress, boolean response) { return connection.flushBatchRequests(this); } + @Override public void invokeCollocated(CollocatedRequestHandler handler) { handler.invokeBatchRequests(this); } + @Override synchronized public void sent() { @@ -180,7 +183,8 @@ public final class BatchOutgoing implements OutgoingMessageCallback _sent = true; notify(); } - + + @Override public synchronized void finished(Ice.Exception ex) { @@ -200,7 +204,7 @@ public final class BatchOutgoing implements OutgoingMessageCallback return _os; } - public void + public void attachRemoteObserver(Ice.ConnectionInfo info, Ice.Endpoint endpt, int size) { if(_observer != null) @@ -213,7 +217,7 @@ public final class BatchOutgoing implements OutgoingMessageCallback } } - public void + public void attachCollocatedObserver(Ice.ObjectAdapter adapter, int requestId) { if(_observer != null) diff --git a/java/src/IceInternal/BatchOutgoingAsync.java b/java/src/IceInternal/BatchOutgoingAsync.java index 072cd8d1b64..1d839796356 100644 --- a/java/src/IceInternal/BatchOutgoingAsync.java +++ b/java/src/IceInternal/BatchOutgoingAsync.java @@ -16,6 +16,7 @@ public class BatchOutgoingAsync extends Ice.AsyncResult implements OutgoingAsync super(communicator, instance, operation, callback); } + @Override public int __send(Ice.ConnectionI connection, boolean compress, boolean response) { @@ -23,13 +24,15 @@ public class BatchOutgoingAsync extends Ice.AsyncResult implements OutgoingAsync return connection.flushAsyncBatchRequests(this); } + @Override public int __invokeCollocated(CollocatedRequestHandler handler) { return handler.invokeAsyncBatchRequests(this); } - public boolean + @Override + public boolean __sent() { synchronized(_monitor) @@ -52,13 +55,15 @@ public class BatchOutgoingAsync extends Ice.AsyncResult implements OutgoingAsync } } - public void + @Override + public void __invokeSent() { __invokeSentInternal(); } - - public void + + @Override + public void __finished(Ice.Exception exc) { synchronized(_monitor) @@ -79,12 +84,14 @@ public class BatchOutgoingAsync extends Ice.AsyncResult implements OutgoingAsync __invokeException(exc); } - public void + @Override + public void __dispatchInvocationTimeout(ThreadPool threadPool, Ice.Connection connection) { threadPool.dispatch( new DispatchWorkItem(connection) { + @Override public void run() { @@ -93,7 +100,8 @@ public class BatchOutgoingAsync extends Ice.AsyncResult implements OutgoingAsync }); } - public void + @Override + public void run() { __runTimerTask(); diff --git a/java/src/IceInternal/CallbackBase.java b/java/src/IceInternal/CallbackBase.java index 23f3fc395f6..61c711f0308 100644 --- a/java/src/IceInternal/CallbackBase.java +++ b/java/src/IceInternal/CallbackBase.java @@ -13,7 +13,7 @@ public abstract class CallbackBase { public abstract void __completed(Ice.AsyncResult r); public abstract void __sent(Ice.AsyncResult r); - + public static void check(boolean cb) { if(!cb) diff --git a/java/src/IceInternal/CollocatedObserverI.java b/java/src/IceInternal/CollocatedObserverI.java index e2355935dca..809cd502d7b 100644 --- a/java/src/IceInternal/CollocatedObserverI.java +++ b/java/src/IceInternal/CollocatedObserverI.java @@ -9,15 +9,17 @@ package IceInternal; -public class CollocatedObserverI - extends IceMX.ObserverWithDelegate<IceMX.CollocatedMetrics, Ice.Instrumentation.CollocatedObserver> +public class CollocatedObserverI + extends IceMX.ObserverWithDelegate<IceMX.CollocatedMetrics, Ice.Instrumentation.CollocatedObserver> implements Ice.Instrumentation.CollocatedObserver { + @Override public void reply(final int size) { forEach(new MetricsUpdate<IceMX.CollocatedMetrics>() { + @Override public void update(IceMX.CollocatedMetrics v) { diff --git a/java/src/IceInternal/CollocatedRequestHandler.java b/java/src/IceInternal/CollocatedRequestHandler.java index 56ef165ada4..1b47feccbb9 100644 --- a/java/src/IceInternal/CollocatedRequestHandler.java +++ b/java/src/IceInternal/CollocatedRequestHandler.java @@ -9,8 +9,6 @@ package IceInternal; -import Ice.Instrumentation.InvocationObserver; - public class CollocatedRequestHandler implements RequestHandler, ResponseHandler { class InvokeAll extends DispatchWorkItem @@ -25,6 +23,7 @@ public class CollocatedRequestHandler implements RequestHandler, ResponseHandler _batch = batch; } + @Override public void run() { @@ -53,6 +52,7 @@ public class CollocatedRequestHandler implements RequestHandler, ResponseHandler _batch = batch; } + @Override public void run() { @@ -93,6 +93,7 @@ public class CollocatedRequestHandler implements RequestHandler, ResponseHandler _batchStream = new BasicStream(ref.getInstance(), Protocol.currentProtocolEncoding, _batchAutoFlush); } + @Override synchronized public void prepareBatchRequest(BasicStream os) { @@ -124,6 +125,7 @@ public class CollocatedRequestHandler implements RequestHandler, ResponseHandler _batchStream.swap(os); } + @Override public void finishBatchRequest(BasicStream os) { @@ -153,6 +155,7 @@ public class CollocatedRequestHandler implements RequestHandler, ResponseHandler _adapter.getThreadPool().dispatch( new DispatchWorkItem() { + @Override public void run() { @@ -198,6 +201,7 @@ public class CollocatedRequestHandler implements RequestHandler, ResponseHandler } } + @Override synchronized public void abortBatchRequest() { @@ -212,6 +216,7 @@ public class CollocatedRequestHandler implements RequestHandler, ResponseHandler notifyAll(); } + @Override public boolean sendRequest(OutgoingMessageCallback out) { @@ -219,12 +224,14 @@ public class CollocatedRequestHandler implements RequestHandler, ResponseHandler return !_response && _reference.getInvocationTimeout() == 0; } + @Override public int sendAsyncRequest(OutgoingAsyncMessageCallback outAsync) { return outAsync.__invokeCollocated(this); } + @Override synchronized public void requestTimedOut(OutgoingMessageCallback out) { @@ -254,7 +261,8 @@ public class CollocatedRequestHandler implements RequestHandler, ResponseHandler } } - synchronized public void + @Override + synchronized public void asyncRequestTimedOut(OutgoingAsyncMessageCallback outAsync) { Integer requestId = _sendAsyncRequests.get(outAsync); @@ -470,6 +478,7 @@ public class CollocatedRequestHandler implements RequestHandler, ResponseHandler } } + @Override public void sendResponse(int requestId, BasicStream os, byte status) { @@ -509,12 +518,14 @@ public class CollocatedRequestHandler implements RequestHandler, ResponseHandler _adapter.decDirectCount(); } + @Override public void sendNoResponse() { _adapter.decDirectCount(); } + @Override public boolean systemException(int requestId, Ice.SystemException ex) { @@ -523,6 +534,7 @@ public class CollocatedRequestHandler implements RequestHandler, ResponseHandler return true; } + @Override public void invokeException(int requestId, Ice.LocalException ex, int invokeNum) { @@ -549,12 +561,14 @@ public class CollocatedRequestHandler implements RequestHandler, ResponseHandler _adapter.decDirectCount(); } + @Override public Reference getReference() { return _reference; } + @Override public Ice.ConnectionI getConnection(boolean wait) { diff --git a/java/src/IceInternal/CommunicatorBatchOutgoingAsync.java b/java/src/IceInternal/CommunicatorBatchOutgoingAsync.java index 8f7f2707a7f..6e96ea9f81f 100644 --- a/java/src/IceInternal/CommunicatorBatchOutgoingAsync.java +++ b/java/src/IceInternal/CommunicatorBatchOutgoingAsync.java @@ -38,16 +38,17 @@ public class CommunicatorBatchOutgoingAsync extends Ice.AsyncResult { class BatchOutgoingAsyncI extends BatchOutgoingAsync { - public + public BatchOutgoingAsyncI() { - super(CommunicatorBatchOutgoingAsync.this._communicator, - CommunicatorBatchOutgoingAsync.this._instance, - CommunicatorBatchOutgoingAsync.this._operation, + super(CommunicatorBatchOutgoingAsync.this._communicator, + CommunicatorBatchOutgoingAsync.this._instance, + CommunicatorBatchOutgoingAsync.this._operation, null); } - public boolean + @Override + public boolean __sent() { if(_childObserver != null) @@ -59,7 +60,7 @@ public class CommunicatorBatchOutgoingAsync extends Ice.AsyncResult return false; } - public void + public void __finished(Ice.LocalException ex, boolean sent) { if(_childObserver != null) @@ -71,6 +72,7 @@ public class CommunicatorBatchOutgoingAsync extends Ice.AsyncResult check(false); } + @Override public void __attachRemoteObserver(Ice.ConnectionInfo info, Ice.Endpoint endpt, int requestId, int size) { @@ -90,7 +92,7 @@ public class CommunicatorBatchOutgoingAsync extends Ice.AsyncResult { ++_useCount; } - + try { int status = con.flushAsyncBatchRequests(new BatchOutgoingAsyncI()); diff --git a/java/src/IceInternal/CommunicatorObserverI.java b/java/src/IceInternal/CommunicatorObserverI.java index fb0b4e8ac62..12360515ef4 100644 --- a/java/src/IceInternal/CommunicatorObserverI.java +++ b/java/src/IceInternal/CommunicatorObserverI.java @@ -25,7 +25,7 @@ public class CommunicatorObserverI implements Ice.Instrumentation.CommunicatorOb r.add("endpointIsSecure", cl.getDeclaredMethod("getEndpointInfo"), cli.getDeclaredMethod("secure")); r.add("endpointTimeout", cl.getDeclaredMethod("getEndpointInfo"), cli.getDeclaredField("timeout")); r.add("endpointCompress", cl.getDeclaredMethod("getEndpointInfo"), cli.getDeclaredField("compress")); - + cli = Ice.IPEndpointInfo.class; r.add("endpointHost", cl.getDeclaredMethod("getEndpointInfo"), cli.getDeclaredField("host")); r.add("endpointPort", cl.getDeclaredMethod("getEndpointInfo"), cli.getDeclaredField("port")); @@ -39,17 +39,17 @@ public class CommunicatorObserverI implements Ice.Instrumentation.CommunicatorOb r.add("incoming", cl.getDeclaredMethod("getConnectionInfo"), cli.getDeclaredField("incoming")); r.add("adapterName", cl.getDeclaredMethod("getConnectionInfo"), cli.getDeclaredField("adapterName")); r.add("connectionId", cl.getDeclaredMethod("getConnectionInfo"), cli.getDeclaredField("connectionId")); - + cli = Ice.IPConnectionInfo.class; r.add("localHost", cl.getDeclaredMethod("getConnectionInfo"), cli.getDeclaredField("localAddress")); r.add("localPort", cl.getDeclaredMethod("getConnectionInfo"), cli.getDeclaredField("localPort")); r.add("remoteHost", cl.getDeclaredMethod("getConnectionInfo"), cli.getDeclaredField("remoteAddress")); r.add("remotePort", cl.getDeclaredMethod("getConnectionInfo"), cli.getDeclaredField("remotePort")); - + cli = Ice.UDPConnectionInfo.class; r.add("mcastHost", cl.getDeclaredMethod("getConnectionInfo"), cli.getDeclaredField("mcastAddress")); r.add("mcastPort", cl.getDeclaredMethod("getConnectionInfo"), cli.getDeclaredField("mcastPort")); - + addEndpointAttributes(r, cl); } @@ -127,8 +127,8 @@ public class CommunicatorObserverI implements Ice.Instrumentation.CommunicatorOb return ""; } } - - public String + + public String getParent() { if(_connectionInfo.adapterName != null && !_connectionInfo.adapterName.isEmpty()) @@ -140,7 +140,7 @@ public class CommunicatorObserverI implements Ice.Instrumentation.CommunicatorOb return "Communicator"; } } - + public Ice.ConnectionInfo getConnectionInfo() { @@ -180,9 +180,9 @@ public class CommunicatorObserverI implements Ice.Instrumentation.CommunicatorOb Class<?> cl = DispatchHelper.class; add("parent", cl.getDeclaredMethod("getParent")); add("id", cl.getDeclaredMethod("getId")); - + addConnectionAttributes(this, cl); - + Class<?> clc = Ice.Current.class; add("operation", cl.getDeclaredMethod("getCurrent"), clc.getDeclaredField("operation")); add("identity", cl.getDeclaredMethod("getIdentity")); @@ -197,7 +197,7 @@ public class CommunicatorObserverI implements Ice.Instrumentation.CommunicatorOb } } }; - + DispatchHelper(Ice.Current current, int size) { super(_attributes); @@ -205,13 +205,15 @@ public class CommunicatorObserverI implements Ice.Instrumentation.CommunicatorOb _size = size; } + @Override public void initMetrics(DispatchMetrics v) { v.size += _size; } - protected String + @Override + protected String defaultResolve(String attribute) { if(attribute.indexOf("context.", 0) == 0) @@ -224,13 +226,13 @@ public class CommunicatorObserverI implements Ice.Instrumentation.CommunicatorOb } throw new IllegalArgumentException(attribute); } - + public String getMode() { return _current.requestId == 0 ? "oneway" : "twoway"; } - + public String getId() { @@ -253,12 +255,12 @@ public class CommunicatorObserverI implements Ice.Instrumentation.CommunicatorOb return _current.requestId; } - public String + public String getParent() { return _current.adapter.getName(); } - + public Ice.ConnectionInfo getConnectionInfo() { @@ -268,7 +270,7 @@ public class CommunicatorObserverI implements Ice.Instrumentation.CommunicatorOb } return null; } - + public Ice.Endpoint getEndpoint() { @@ -284,7 +286,7 @@ public class CommunicatorObserverI implements Ice.Instrumentation.CommunicatorOb { return _current.con; } - + public Ice.EndpointInfo getEndpointInfo() { @@ -300,13 +302,13 @@ public class CommunicatorObserverI implements Ice.Instrumentation.CommunicatorOb { return _current; } - + public String getIdentity() { return _current.adapter.getCommunicator().identityToString(_current.id); } - + final private Ice.Current _current; final private int _size; private String _id; @@ -316,17 +318,17 @@ public class CommunicatorObserverI implements Ice.Instrumentation.CommunicatorOb static public final class InvocationHelper extends MetricsHelper<InvocationMetrics> { static private final AttributeResolver _attributes = new AttributeResolver() - { + { { try { Class<?> cl = InvocationHelper.class; add("parent", cl.getDeclaredMethod("getParent")); add("id", cl.getDeclaredMethod("getId")); - + add("operation", cl.getDeclaredMethod("getOperation")); add("identity", cl.getDeclaredMethod("getIdentity")); - + Class<?> cli = Ice.ObjectPrx.class; add("facet", cl.getDeclaredMethod("getProxy"), cli.getDeclaredMethod("ice_getFacet")); add("encoding", cl.getDeclaredMethod("getEncodingVersion")); @@ -340,7 +342,7 @@ public class CommunicatorObserverI implements Ice.Instrumentation.CommunicatorOb } } }; - + InvocationHelper(Ice.ObjectPrx proxy, String op, java.util.Map<String, String> ctx) { super(_attributes); @@ -349,7 +351,8 @@ public class CommunicatorObserverI implements Ice.Instrumentation.CommunicatorOb _context = ctx; } - protected String + @Override + protected String defaultResolve(String attribute) { if(attribute.indexOf("context.", 0) == 0) @@ -362,7 +365,7 @@ public class CommunicatorObserverI implements Ice.Instrumentation.CommunicatorOb } throw new IllegalArgumentException(attribute); } - + public String getMode() { @@ -370,27 +373,27 @@ public class CommunicatorObserverI implements Ice.Instrumentation.CommunicatorOb { throw new IllegalArgumentException("mode"); } - + if(_proxy.ice_isTwoway()) { return "twoway"; - } + } else if(_proxy.ice_isOneway()) { return "oneway"; - } + } else if(_proxy.ice_isBatchOneway()) { return "batch-oneway"; - } + } else if(_proxy.ice_isDatagram()) { return "datagram"; - } + } else if(_proxy.ice_isBatchDatagram()) { return "batch-datagram"; - } + } else { throw new IllegalArgumentException("mode"); @@ -424,13 +427,13 @@ public class CommunicatorObserverI implements Ice.Instrumentation.CommunicatorOb } return _id; } - - public String + + public String getParent() { return "Communicator"; } - + public Ice.ObjectPrx getProxy() { @@ -456,12 +459,12 @@ public class CommunicatorObserverI implements Ice.Instrumentation.CommunicatorOb return _operation; } - public String + public String getEncodingVersion() { return Ice.Util.encodingVersionToString(_proxy.ice_getEncodingVersion()); } - + final private Ice.ObjectPrx _proxy; final private String _operation; final private java.util.Map<String, String> _context; @@ -469,11 +472,11 @@ public class CommunicatorObserverI implements Ice.Instrumentation.CommunicatorOb static final private Ice.Endpoint[] emptyEndpoints = new Ice.Endpoint[0]; }; - + static public final class ThreadHelper extends MetricsHelper<ThreadMetrics> { static private final AttributeResolver _attributes = new AttributeResolver() - { + { { try { @@ -495,7 +498,8 @@ public class CommunicatorObserverI implements Ice.Instrumentation.CommunicatorOb _state = state; } - public void + @Override + public void initMetrics(ThreadMetrics v) { switch(_state) @@ -513,7 +517,7 @@ public class CommunicatorObserverI implements Ice.Instrumentation.CommunicatorOb break; } } - + final public String _parent; final public String _id; final private Ice.Instrumentation.ThreadState _state; @@ -522,7 +526,7 @@ public class CommunicatorObserverI implements Ice.Instrumentation.CommunicatorOb static public final class EndpointHelper extends MetricsHelper<Metrics> { static private final AttributeResolver _attributes = new AttributeResolver() - { + { { try { @@ -550,7 +554,7 @@ public class CommunicatorObserverI implements Ice.Instrumentation.CommunicatorOb super(_attributes); _endpoint = endpt; } - + public Ice.EndpointInfo getEndpointInfo() { @@ -566,7 +570,7 @@ public class CommunicatorObserverI implements Ice.Instrumentation.CommunicatorOb { return "Communicator"; } - + public String getId() { @@ -576,25 +580,25 @@ public class CommunicatorObserverI implements Ice.Instrumentation.CommunicatorOb } return _id; } - + public String getEndpoint() { return _endpoint.toString(); } - + final private Ice.Endpoint _endpoint; private String _id; private Ice.EndpointInfo _endpointInfo; }; - public + public CommunicatorObserverI(IceInternal.MetricsAdminI metrics) { this(metrics, null); } - public + public CommunicatorObserverI(IceInternal.MetricsAdminI metrics, Ice.Instrumentation.CommunicatorObserver delegate) { _metrics = metrics; @@ -608,16 +612,16 @@ public class CommunicatorObserverI implements Ice.Instrumentation.CommunicatorOb Ice.Instrumentation.InvocationObserver>(metrics, "Invocation", InvocationMetrics.class); _threads = new ObserverFactoryWithDelegate<ThreadMetrics, ThreadObserverI, Ice.Instrumentation.ThreadObserver>(metrics, "Thread", ThreadMetrics.class); - _connects = new ObserverFactoryWithDelegate<Metrics, ObserverWithDelegateI, + _connects = new ObserverFactoryWithDelegate<Metrics, ObserverWithDelegateI, Ice.Instrumentation.Observer>(metrics, "ConnectionEstablishment", Metrics.class); _endpointLookups = new ObserverFactoryWithDelegate<Metrics, ObserverWithDelegateI, Ice.Instrumentation.Observer>(metrics, "EndpointLookup", Metrics.class); try { - _invocations.registerSubMap("Remote", RemoteMetrics.class, + _invocations.registerSubMap("Remote", RemoteMetrics.class, InvocationMetrics.class.getDeclaredField("remotes")); - _invocations.registerSubMap("Collocated", CollocatedMetrics.class, + _invocations.registerSubMap("Collocated", CollocatedMetrics.class, InvocationMetrics.class.getDeclaredField("collocated")); } catch(Exception ex) @@ -626,6 +630,7 @@ public class CommunicatorObserverI implements Ice.Instrumentation.CommunicatorOb } } + @Override public Ice.Instrumentation.Observer getConnectionEstablishmentObserver(Ice.Endpoint endpt, String connector) { @@ -638,7 +643,7 @@ public class CommunicatorObserverI implements Ice.Instrumentation.CommunicatorOb { delegate = _delegate.getConnectionEstablishmentObserver(endpt, connector); } - return _connects.getObserver(new EndpointHelper(endpt, connector), ObserverWithDelegateI.class, + return _connects.getObserver(new EndpointHelper(endpt, connector), ObserverWithDelegateI.class, delegate); } catch(Exception ex) @@ -649,7 +654,8 @@ public class CommunicatorObserverI implements Ice.Instrumentation.CommunicatorOb return null; } - public Ice.Instrumentation.Observer + @Override + public Ice.Instrumentation.Observer getEndpointLookupObserver(Ice.Endpoint endpt) { if(_endpointLookups.isEnabled()) @@ -671,8 +677,9 @@ public class CommunicatorObserverI implements Ice.Instrumentation.CommunicatorOb } return null; } - - public Ice.Instrumentation.ConnectionObserver + + @Override + public Ice.Instrumentation.ConnectionObserver getConnectionObserver(Ice.ConnectionInfo c, Ice.Endpoint e, Ice.Instrumentation.ConnectionState s, Ice.Instrumentation.ConnectionObserver observer) { @@ -695,9 +702,10 @@ public class CommunicatorObserverI implements Ice.Instrumentation.CommunicatorOb } return null; } - - public Ice.Instrumentation.ThreadObserver - getThreadObserver(String parent, String id, Ice.Instrumentation.ThreadState s, + + @Override + public Ice.Instrumentation.ThreadObserver + getThreadObserver(String parent, String id, Ice.Instrumentation.ThreadState s, Ice.Instrumentation.ThreadObserver observer) { if(_threads.isEnabled()) @@ -719,7 +727,8 @@ public class CommunicatorObserverI implements Ice.Instrumentation.CommunicatorOb } return null; } - + + @Override public Ice.Instrumentation.InvocationObserver getInvocationObserver(Ice.ObjectPrx prx, String operation, java.util.Map<java.lang.String, java.lang.String> ctx) { @@ -732,7 +741,7 @@ public class CommunicatorObserverI implements Ice.Instrumentation.CommunicatorOb { delegate = _delegate.getInvocationObserver(prx, operation, ctx); } - return _invocations.getObserver(new InvocationHelper(prx, operation, ctx), + return _invocations.getObserver(new InvocationHelper(prx, operation, ctx), InvocationObserverI.class, delegate); } @@ -743,7 +752,8 @@ public class CommunicatorObserverI implements Ice.Instrumentation.CommunicatorOb } return null; } - + + @Override public Ice.Instrumentation.DispatchObserver getDispatchObserver(Ice.Current c, int size) { @@ -765,8 +775,9 @@ public class CommunicatorObserverI implements Ice.Instrumentation.CommunicatorOb } return null; } - - public void + + @Override + public void setObserverUpdater(final Ice.Instrumentation.ObserverUpdater updater) { if(updater == null) @@ -777,13 +788,15 @@ public class CommunicatorObserverI implements Ice.Instrumentation.CommunicatorOb else { _connections.setUpdater(new Runnable() { - public void + @Override + public void run() { updater.updateConnectionObservers(); } }); - _threads.setUpdater(new Runnable() { + _threads.setUpdater(new Runnable() { + @Override public void run() { diff --git a/java/src/IceInternal/ConnectRequestHandler.java b/java/src/IceInternal/ConnectRequestHandler.java index 6c08f7dc261..276395ef3ef 100644 --- a/java/src/IceInternal/ConnectRequestHandler.java +++ b/java/src/IceInternal/ConnectRequestHandler.java @@ -9,8 +9,6 @@ package IceInternal; -import Ice.Instrumentation.InvocationObserver; - public class ConnectRequestHandler implements RequestHandler, Reference.GetConnectionCallback, RouterInfo.AddProxyCallback { @@ -57,6 +55,7 @@ public class ConnectRequestHandler } } + @Override public void prepareBatchRequest(BasicStream os) throws RetryException @@ -92,12 +91,13 @@ public class ConnectRequestHandler _connection.prepareBatchRequest(os); } + @Override public void finishBatchRequest(BasicStream os) { synchronized(this) { - if(!initialized()) // This can't throw until _batchRequestInProgress = false + if(!initialized()) // This can't throw until _batchRequestInProgress = false { assert(_batchRequestInProgress); _batchRequestInProgress = false; @@ -119,6 +119,7 @@ public class ConnectRequestHandler _connection.finishBatchRequest(os, _compress); } + @Override public void abortBatchRequest() { @@ -141,6 +142,7 @@ public class ConnectRequestHandler _connection.abortBatchRequest(); } + @Override public boolean sendRequest(OutgoingMessageCallback out) throws RetryException @@ -163,6 +165,7 @@ public class ConnectRequestHandler return out.send(_connection, _compress, _response) && !_response; // Finished if sent and no response. } + @Override public int sendAsyncRequest(OutgoingAsyncMessageCallback out) throws RetryException @@ -185,7 +188,8 @@ public class ConnectRequestHandler return out.__send(_connection, _compress, _response); } - public void + @Override + public void requestTimedOut(OutgoingMessageCallback out) { synchronized(this) @@ -214,7 +218,8 @@ public class ConnectRequestHandler _connection.requestTimedOut(out); } - public void + @Override + public void asyncRequestTimedOut(OutgoingAsyncMessageCallback outAsync) { synchronized(this) @@ -243,12 +248,14 @@ public class ConnectRequestHandler _connection.asyncRequestTimedOut(outAsync); } + @Override public Reference getReference() { return _reference; } + @Override synchronized public Ice.ConnectionI getConnection(boolean waitInit) { @@ -284,6 +291,7 @@ public class ConnectRequestHandler // Implementation of Reference.GetConnectionCallback // + @Override public void setConnection(Ice.ConnectionI connection, boolean compress) { @@ -312,6 +320,7 @@ public class ConnectRequestHandler flushRequests(); } + @Override public synchronized void setException(final Ice.LocalException ex) { @@ -330,6 +339,7 @@ public class ConnectRequestHandler { _reference.getInstance().clientThreadPool().dispatch(new DispatchWorkItem(_connection) { + @Override public void run() { @@ -344,6 +354,7 @@ public class ConnectRequestHandler // // Implementation of RouterInfo.AddProxyCallback // + @Override public void addedProxy() { @@ -444,7 +455,7 @@ public class ConnectRequestHandler } else if(request.outAsync != null) { - if((request.outAsync.__send(_connection, _compress, _response) & + if((request.outAsync.__send(_connection, _compress, _response) & AsyncStatus.InvokeSentCallback) > 0) { sentCallbacks.add(request.outAsync); @@ -477,13 +488,14 @@ public class ConnectRequestHandler // RetryException. We handle the exception like it // was an exception that occured while sending the // request. - // + // synchronized(this) { assert(_exception == null && !_requests.isEmpty()); _exception = ex.get(); _reference.getInstance().clientThreadPool().dispatch(new DispatchWorkItem(_connection) { + @Override public void run() { @@ -500,6 +512,7 @@ public class ConnectRequestHandler _exception = ex; _reference.getInstance().clientThreadPool().dispatch(new DispatchWorkItem(_connection) { + @Override public void run() { @@ -514,6 +527,7 @@ public class ConnectRequestHandler _reference.getInstance().clientThreadPool().dispatch( new DispatchWorkItem(_connection) { + @Override public void run() { @@ -524,7 +538,7 @@ public class ConnectRequestHandler }; }); } - + // // We've finished sending the queued requests and the request handler now send // the requests over the connection directly. It's time to substitute the @@ -558,7 +572,7 @@ public class ConnectRequestHandler for(Request request : _requests) { if(request.out != null) - { + { request.out.finished(_exception); } else if(request.outAsync != null) diff --git a/java/src/IceInternal/ConnectionACMMonitor.java b/java/src/IceInternal/ConnectionACMMonitor.java index effc30949eb..38c57189dd9 100644 --- a/java/src/IceInternal/ConnectionACMMonitor.java +++ b/java/src/IceInternal/ConnectionACMMonitor.java @@ -19,6 +19,7 @@ class ConnectionACMMonitor implements ACMMonitor _config = config; } + @Override protected synchronized void finalize() throws Throwable @@ -36,6 +37,7 @@ class ConnectionACMMonitor implements ACMMonitor } } + @Override public synchronized void add(Ice.ConnectionI connection) { @@ -48,6 +50,7 @@ class ConnectionACMMonitor implements ACMMonitor } } + @Override public synchronized void remove(Ice.ConnectionI connection) { @@ -59,19 +62,22 @@ class ConnectionACMMonitor implements ACMMonitor _future = null; } } - + + @Override public void reap(Ice.ConnectionI connection) { _parent.reap(connection); } - + + @Override public ACMMonitor acm(Ice.IntOptional timeout, Ice.Optional<Ice.ACMClose> close, Ice.Optional<Ice.ACMHeartbeat> heartbeat) { return _parent.acm(timeout, close, heartbeat); } - + + @Override public Ice.ACM getACM() { @@ -81,7 +87,8 @@ class ConnectionACMMonitor implements ACMMonitor acm.heartbeat = _config.heartbeat; return acm; } - + + @Override public void run() { @@ -94,13 +101,13 @@ class ConnectionACMMonitor implements ACMMonitor } connection = _connection; } - + try - { + { connection.monitor(Time.currentMonotonicTimeMillis(), _config); } catch(Exception ex) - { + { _parent.handleException(ex); } } diff --git a/java/src/IceInternal/ConnectionObserverI.java b/java/src/IceInternal/ConnectionObserverI.java index b64eda3c186..89dd07aec5d 100644 --- a/java/src/IceInternal/ConnectionObserverI.java +++ b/java/src/IceInternal/ConnectionObserverI.java @@ -9,11 +9,12 @@ package IceInternal; -public class ConnectionObserverI - extends IceMX.ObserverWithDelegate<IceMX.ConnectionMetrics, Ice.Instrumentation.ConnectionObserver> +public class ConnectionObserverI + extends IceMX.ObserverWithDelegate<IceMX.ConnectionMetrics, Ice.Instrumentation.ConnectionObserver> implements Ice.Instrumentation.ConnectionObserver { - public void + @Override + public void sentBytes(final int num) { _sentBytes = num; @@ -24,7 +25,8 @@ public class ConnectionObserverI } } - public void + @Override + public void receivedBytes(int num) { _receivedBytes = num; @@ -37,6 +39,7 @@ public class ConnectionObserverI private MetricsUpdate<IceMX.ConnectionMetrics> _sentBytesUpdate = new MetricsUpdate<IceMX.ConnectionMetrics>() { + @Override public void update(IceMX.ConnectionMetrics v) { @@ -46,6 +49,7 @@ public class ConnectionObserverI private MetricsUpdate<IceMX.ConnectionMetrics> _receivedBytesUpdate = new MetricsUpdate<IceMX.ConnectionMetrics>() { + @Override public void update(IceMX.ConnectionMetrics v) { diff --git a/java/src/IceInternal/ConnectionRequestHandler.java b/java/src/IceInternal/ConnectionRequestHandler.java index 7820790e794..8d44be04e5b 100644 --- a/java/src/IceInternal/ConnectionRequestHandler.java +++ b/java/src/IceInternal/ConnectionRequestHandler.java @@ -9,10 +9,9 @@ package IceInternal; -import Ice.Instrumentation.InvocationObserver; - public class ConnectionRequestHandler implements RequestHandler { + @Override public void prepareBatchRequest(BasicStream out) throws RetryException @@ -20,18 +19,21 @@ public class ConnectionRequestHandler implements RequestHandler _connection.prepareBatchRequest(out); } + @Override public void finishBatchRequest(BasicStream out) { _connection.finishBatchRequest(out, _compress); } + @Override public void abortBatchRequest() { _connection.abortBatchRequest(); } + @Override public boolean sendRequest(OutgoingMessageCallback out) throws RetryException @@ -39,6 +41,7 @@ public class ConnectionRequestHandler implements RequestHandler return out.send(_connection, _compress, _response) && !_response; // Finished if sent and no response } + @Override public int sendAsyncRequest(OutgoingAsyncMessageCallback out) throws RetryException @@ -46,31 +49,35 @@ public class ConnectionRequestHandler implements RequestHandler return out.__send(_connection, _compress, _response); } - public void + @Override + public void requestTimedOut(OutgoingMessageCallback out) { _connection.requestTimedOut(out); } - public void + @Override + public void asyncRequestTimedOut(OutgoingAsyncMessageCallback outAsync) { _connection.asyncRequestTimedOut(outAsync); } - public Reference + @Override + public Reference getReference() { return _reference; } + @Override public Ice.ConnectionI getConnection(boolean wait) { return _connection; } - public + public ConnectionRequestHandler(Reference ref, Ice.ObjectPrx proxy) { _reference = ref; diff --git a/java/src/IceInternal/Connector.java b/java/src/IceInternal/Connector.java index 9dbfb5eded3..be814de04df 100644 --- a/java/src/IceInternal/Connector.java +++ b/java/src/IceInternal/Connector.java @@ -14,10 +14,12 @@ public interface Connector Transceiver connect(); short type(); + @Override String toString(); // // Compare connectors for sorting process. // + @Override boolean equals(java.lang.Object obj); } diff --git a/java/src/IceInternal/DictionaryPatcher.java b/java/src/IceInternal/DictionaryPatcher.java index a4978f9f511..6413c73444e 100644 --- a/java/src/IceInternal/DictionaryPatcher.java +++ b/java/src/IceInternal/DictionaryPatcher.java @@ -20,6 +20,7 @@ public class DictionaryPatcher<K, V> implements Patcher, Ice.ReadObjectCallback _key = key; } + @Override public void patch(Ice.Object v) { @@ -38,12 +39,14 @@ public class DictionaryPatcher<K, V> implements Patcher, Ice.ReadObjectCallback _dict.put(_key, _cls.cast(v)); } + @Override public String type() { return _type; } + @Override public void invoke(Ice.Object v) { diff --git a/java/src/IceInternal/DispatchObserverI.java b/java/src/IceInternal/DispatchObserverI.java index 97b739cb5f2..4aab7c449bb 100644 --- a/java/src/IceInternal/DispatchObserverI.java +++ b/java/src/IceInternal/DispatchObserverI.java @@ -9,10 +9,11 @@ package IceInternal; -public class DispatchObserverI - extends IceMX.ObserverWithDelegate<IceMX.DispatchMetrics, Ice.Instrumentation.DispatchObserver> +public class DispatchObserverI + extends IceMX.ObserverWithDelegate<IceMX.DispatchMetrics, Ice.Instrumentation.DispatchObserver> implements Ice.Instrumentation.DispatchObserver { + @Override public void userException() { @@ -23,11 +24,13 @@ public class DispatchObserverI } } + @Override public void reply(final int size) { forEach(new MetricsUpdate<IceMX.DispatchMetrics>() { + @Override public void update(IceMX.DispatchMetrics v) { @@ -42,6 +45,7 @@ public class DispatchObserverI final MetricsUpdate<IceMX.DispatchMetrics> _userException = new MetricsUpdate<IceMX.DispatchMetrics>() { + @Override public void update(IceMX.DispatchMetrics v) { diff --git a/java/src/IceInternal/DispatchWorkItem.java b/java/src/IceInternal/DispatchWorkItem.java index 94fea26ada5..32eb98a6f9f 100644 --- a/java/src/IceInternal/DispatchWorkItem.java +++ b/java/src/IceInternal/DispatchWorkItem.java @@ -11,7 +11,7 @@ package IceInternal; // // A helper class for thread pool work items that only need to call user -// callbacks. If a dispatcher is installed with the communicator, the +// callbacks. If a dispatcher is installed with the communicator, the // thread pool work item is executed with the dispatcher, otherwise it's // executed by a thread pool thread (after promoting a follower thread). // @@ -26,14 +26,15 @@ abstract public class DispatchWorkItem implements ThreadPoolWorkItem, Runnable _connection = connection; } - final public void + @Override + final public void execute(ThreadPoolCurrent current) { current.ioCompleted(); // Promote a follower current.dispatchFromThisThread(this); } - public Ice.Connection + public Ice.Connection getConnection() { return _connection; diff --git a/java/src/IceInternal/EndpointHostResolver.java b/java/src/IceInternal/EndpointHostResolver.java index 898055c102b..66a75956a3d 100644 --- a/java/src/IceInternal/EndpointHostResolver.java +++ b/java/src/IceInternal/EndpointHostResolver.java @@ -173,7 +173,7 @@ public class EndpointHostResolver break; } - r = (ResolveEntry)_queue.removeFirst(); + r = _queue.removeFirst(); threadObserver = _observer; } @@ -278,6 +278,7 @@ public class EndpointHostResolver setName(threadName + "Ice.HostResolver"); } + @Override public void run() { try diff --git a/java/src/IceInternal/EndpointI.java b/java/src/IceInternal/EndpointI.java index 6d91760b570..10248ba71c1 100644 --- a/java/src/IceInternal/EndpointI.java +++ b/java/src/IceInternal/EndpointI.java @@ -11,11 +11,13 @@ package IceInternal; abstract public class EndpointI implements Ice.Endpoint, java.lang.Comparable<EndpointI> { + @Override public String toString() { return _toString(); } + @Override public String _toString() { // @@ -177,6 +179,7 @@ abstract public class EndpointI implements Ice.Endpoint, java.lang.Comparable<En // // Compare endpoints for sorting purposes. // + @Override public boolean equals(java.lang.Object obj) { if(!(obj instanceof EndpointI)) diff --git a/java/src/IceInternal/EventHandler.java b/java/src/IceInternal/EventHandler.java index 5dc747b2118..5e5965a890c 100644 --- a/java/src/IceInternal/EventHandler.java +++ b/java/src/IceInternal/EventHandler.java @@ -24,6 +24,7 @@ public abstract class EventHandler // // Get a textual representation of the event handler. // + @Override abstract public String toString(); // diff --git a/java/src/IceInternal/Ex.java b/java/src/IceInternal/Ex.java index 65603c0edbf..8c09d61781e 100644 --- a/java/src/IceInternal/Ex.java +++ b/java/src/IceInternal/Ex.java @@ -39,7 +39,7 @@ public class Ex // A small utility to get the strack trace of the exception (which also includes toString()). // public static String toString(java.lang.Throwable ex) - { + { java.io.StringWriter sw = new java.io.StringWriter(); java.io.PrintWriter pw = new java.io.PrintWriter(sw); ex.printStackTrace(pw); diff --git a/java/src/IceInternal/FactoryACMMonitor.java b/java/src/IceInternal/FactoryACMMonitor.java index 7a328a8b790..420513ff9dd 100644 --- a/java/src/IceInternal/FactoryACMMonitor.java +++ b/java/src/IceInternal/FactoryACMMonitor.java @@ -28,8 +28,9 @@ class FactoryACMMonitor implements ACMMonitor _instance = instance; _config = config; } - - protected synchronized void + + @Override + protected synchronized void finalize() throws Throwable { @@ -61,6 +62,7 @@ class FactoryACMMonitor implements ACMMonitor _changes.clear(); } + @Override public void add(Ice.ConnectionI connection) { @@ -85,6 +87,7 @@ class FactoryACMMonitor implements ACMMonitor } } + @Override public void remove(Ice.ConnectionI connection) { @@ -92,7 +95,7 @@ class FactoryACMMonitor implements ACMMonitor { return; } - + synchronized(this) { assert(_instance != null); @@ -100,17 +103,19 @@ class FactoryACMMonitor implements ACMMonitor } } + @Override public synchronized void reap(Ice.ConnectionI connection) { _reapedConnections.add(connection); } + @Override public synchronized ACMMonitor acm(Ice.IntOptional timeout, Ice.Optional<Ice.ACMClose> close, Ice.Optional<Ice.ACMHeartbeat> heartbeat) { assert(_instance != null); - + ACMConfig config = (ACMConfig)_config.clone(); if(timeout != null && timeout.isSet()) { @@ -126,8 +131,9 @@ class FactoryACMMonitor implements ACMMonitor } return new ConnectionACMMonitor(this, _instance.timer(), config); } - - public Ice.ACM + + @Override + public Ice.ACM getACM() { Ice.ACM acm = new Ice.ACM(); @@ -136,7 +142,7 @@ class FactoryACMMonitor implements ACMMonitor acm.heartbeat = _config.heartbeat; return acm; } - + synchronized java.util.List<Ice.ConnectionI> swapReapedConnections() { @@ -149,6 +155,7 @@ class FactoryACMMonitor implements ACMMonitor return connections; } + @Override public void run() { @@ -179,8 +186,8 @@ class FactoryACMMonitor implements ACMMonitor return; } } - - + + // // Monitor connections outside the thread synchronization, so // that connections can be added or removed during monitoring. @@ -189,23 +196,23 @@ class FactoryACMMonitor implements ACMMonitor for(Ice.ConnectionI connection : _connections) { try - { + { connection.monitor(now, _config); } catch(Exception ex) - { + { handleException(ex); } } } - + synchronized void handleException(Exception ex) { if(_instance == null) { return; - } + } _instance.initializationData().logger.error("exception in connection monitor:\n" + ex); } diff --git a/java/src/IceInternal/FixedReference.java b/java/src/IceInternal/FixedReference.java index 1616b29c4d7..9df5d5f4b68 100644 --- a/java/src/IceInternal/FixedReference.java +++ b/java/src/IceInternal/FixedReference.java @@ -25,144 +25,168 @@ public class FixedReference extends Reference _fixedConnection = connection; } + @Override public EndpointI[] getEndpoints() { return _emptyEndpoints; } + @Override public String getAdapterId() { return ""; } + @Override public LocatorInfo getLocatorInfo() { return null; } + @Override public RouterInfo getRouterInfo() { return null; } + @Override public boolean getCollocationOptimized() { return false; } - + + @Override public final boolean getCacheConnection() { return true; } + @Override public boolean getPreferSecure() { return false; } + @Override public final Ice.EndpointSelectionType getEndpointSelection() { return Ice.EndpointSelectionType.Random; } + @Override public int getLocatorCacheTimeout() { return 0; } + @Override public String getConnectionId() { return ""; } + @Override public Reference changeEndpoints(EndpointI[] newEndpoints) { throw new Ice.FixedProxyException(); } + @Override public Reference changeAdapterId(String newAdapterId) { throw new Ice.FixedProxyException(); } + @Override public Reference changeLocator(Ice.LocatorPrx newLocator) { throw new Ice.FixedProxyException(); } + @Override public Reference changeRouter(Ice.RouterPrx newRouter) { throw new Ice.FixedProxyException(); } + @Override public Reference changeCollocationOptimized(boolean newCollocationOptimized) { throw new Ice.FixedProxyException(); } + @Override public final Reference changeCacheConnection(boolean newCache) { throw new Ice.FixedProxyException(); } + @Override public Reference changePreferSecure(boolean prefSec) { throw new Ice.FixedProxyException(); } + @Override public final Reference changeEndpointSelection(Ice.EndpointSelectionType newType) { throw new Ice.FixedProxyException(); } + @Override public Reference changeLocatorCacheTimeout(int newTimeout) { throw new Ice.FixedProxyException(); } + @Override public Reference changeTimeout(int newTimeout) { throw new Ice.FixedProxyException(); } + @Override public Reference changeConnectionId(String connectionId) { throw new Ice.FixedProxyException(); } + @Override public boolean isIndirect() { return false; } + @Override public boolean isWellKnown() { return false; } + @Override public void streamWrite(BasicStream s) throws Ice.MarshalException @@ -170,6 +194,7 @@ public class FixedReference extends Reference throw new Ice.FixedProxyException(); } + @Override public String toString() throws Ice.MarshalException @@ -177,12 +202,14 @@ public class FixedReference extends Reference throw new Ice.FixedProxyException(); } + @Override public java.util.Map<String, String> toProperty(String prefix) { throw new Ice.FixedProxyException(); } + @Override public Ice.ConnectionI getConnection(Ice.BooleanHolder compress) { @@ -246,6 +273,7 @@ public class FixedReference extends Reference return _fixedConnection; } + @Override public void getConnection(GetConnectionCallback callback) { @@ -261,6 +289,7 @@ public class FixedReference extends Reference } } + @Override public boolean equals(java.lang.Object obj) { @@ -280,6 +309,7 @@ public class FixedReference extends Reference return _fixedConnection.equals(rhs._fixedConnection); } + @Override public int hashCode() { diff --git a/java/src/IceInternal/Functional_CallbackBase.java b/java/src/IceInternal/Functional_CallbackBase.java index 1e61ca2e506..4665f8b49a6 100644 --- a/java/src/IceInternal/Functional_CallbackBase.java +++ b/java/src/IceInternal/Functional_CallbackBase.java @@ -19,14 +19,15 @@ public abstract class Functional_CallbackBase extends IceInternal.CallbackBase __exceptionCb = exceptionCb; __sentCb = sentCb; } - + protected Functional_CallbackBase(Functional_GenericCallback1<Ice.Exception> exceptionCb, Functional_BoolCallback sentCb) { __exceptionCb = exceptionCb; __sentCb = sentCb; } - + + @Override public final void __sent(Ice.AsyncResult __result) { if(__sentCb != null) @@ -35,8 +36,9 @@ public abstract class Functional_CallbackBase extends IceInternal.CallbackBase } } + @Override public abstract void __completed(Ice.AsyncResult __result); - + protected final Functional_GenericCallback1<Ice.Exception> __exceptionCb; protected final Functional_BoolCallback __sentCb; } diff --git a/java/src/IceInternal/Functional_OnewayCallback.java b/java/src/IceInternal/Functional_OnewayCallback.java index 4b7da7baa07..d9f77c1359f 100644 --- a/java/src/IceInternal/Functional_OnewayCallback.java +++ b/java/src/IceInternal/Functional_OnewayCallback.java @@ -11,7 +11,7 @@ package IceInternal; public class Functional_OnewayCallback extends IceInternal.Functional_CallbackBase { - public Functional_OnewayCallback(Functional_VoidCallback responseCb, + public Functional_OnewayCallback(Functional_VoidCallback responseCb, Functional_GenericCallback1<Ice.Exception> exceptionCb, Functional_BoolCallback sentCb) { @@ -20,6 +20,7 @@ public class Functional_OnewayCallback extends IceInternal.Functional_CallbackBa __responseCb = responseCb; } + @Override public final void __completed(Ice.AsyncResult __result) { try @@ -38,6 +39,6 @@ public class Functional_OnewayCallback extends IceInternal.Functional_CallbackBa } } } - + private final Functional_VoidCallback __responseCb; } diff --git a/java/src/IceInternal/Functional_TwowayCallback.java b/java/src/IceInternal/Functional_TwowayCallback.java index 91d02d81a37..80fe83192b5 100644 --- a/java/src/IceInternal/Functional_TwowayCallback.java +++ b/java/src/IceInternal/Functional_TwowayCallback.java @@ -17,13 +17,14 @@ public abstract class Functional_TwowayCallback extends IceInternal.Functional_C { super(responseCb, exceptionCb, sentCb); } - + protected Functional_TwowayCallback(Functional_GenericCallback1<Ice.Exception> exceptionCb, Functional_BoolCallback sentCb) { super(exceptionCb, sentCb); } - + + @Override public void exception(Ice.SystemException ex) { if(__exceptionCb != null) @@ -32,6 +33,7 @@ public abstract class Functional_TwowayCallback extends IceInternal.Functional_C } } + @Override public final void exception(Ice.LocalException ex) { if(__exceptionCb != null) diff --git a/java/src/IceInternal/Functional_TwowayCallbackArg1.java b/java/src/IceInternal/Functional_TwowayCallbackArg1.java index 5afa99612c4..7c3d471c023 100644 --- a/java/src/IceInternal/Functional_TwowayCallbackArg1.java +++ b/java/src/IceInternal/Functional_TwowayCallbackArg1.java @@ -12,24 +12,25 @@ package IceInternal; public abstract class Functional_TwowayCallbackArg1<T> extends Functional_TwowayCallback implements Ice.TwowayCallbackArg1<T> { - public Functional_TwowayCallbackArg1(Functional_GenericCallback1<T> responseCb, - Functional_GenericCallback1<Ice.Exception> exceptionCb, + public Functional_TwowayCallbackArg1(Functional_GenericCallback1<T> responseCb, + Functional_GenericCallback1<Ice.Exception> exceptionCb, Functional_BoolCallback sentCb) { super(responseCb != null, exceptionCb, sentCb); __responseCb = responseCb; } - + protected Functional_TwowayCallbackArg1(boolean userExceptionCb, - Functional_GenericCallback1<T> responseCb, - Functional_GenericCallback1<Ice.Exception> exceptionCb, + Functional_GenericCallback1<T> responseCb, + Functional_GenericCallback1<Ice.Exception> exceptionCb, Functional_BoolCallback sentCb) { super(exceptionCb, sentCb); CallbackBase.check(responseCb != null || (userExceptionCb && exceptionCb != null)); __responseCb = responseCb; } - + + @Override public void response(T arg) { if(__responseCb != null) @@ -37,6 +38,6 @@ public abstract class Functional_TwowayCallbackArg1<T> extends Functional_Twoway __responseCb.apply(arg); } } - + final private Functional_GenericCallback1<T> __responseCb; }; diff --git a/java/src/IceInternal/Functional_TwowayCallbackArg1UE.java b/java/src/IceInternal/Functional_TwowayCallbackArg1UE.java index 93e81bdf82f..30383c7b56a 100644 --- a/java/src/IceInternal/Functional_TwowayCallbackArg1UE.java +++ b/java/src/IceInternal/Functional_TwowayCallbackArg1UE.java @@ -9,19 +9,20 @@ package IceInternal; -public abstract class Functional_TwowayCallbackArg1UE<T> +public abstract class Functional_TwowayCallbackArg1UE<T> extends Functional_TwowayCallbackArg1<T> implements Ice.TwowayCallbackArg1UE<T> { public Functional_TwowayCallbackArg1UE( - Functional_GenericCallback1<T> responseCb, - Functional_GenericCallback1<Ice.UserException> userExceptionCb, - Functional_GenericCallback1<Ice.Exception> exceptionCb, + Functional_GenericCallback1<T> responseCb, + Functional_GenericCallback1<Ice.UserException> userExceptionCb, + Functional_GenericCallback1<Ice.Exception> exceptionCb, Functional_BoolCallback sentCb) { super(userExceptionCb != null, responseCb, exceptionCb, sentCb); __userExceptionCb = userExceptionCb; } + @Override public void exception(Ice.UserException ex) { if(__userExceptionCb != null) @@ -29,6 +30,6 @@ public abstract class Functional_TwowayCallbackArg1UE<T> __userExceptionCb.apply(ex); } } - + private final Functional_GenericCallback1<Ice.UserException> __userExceptionCb; }; diff --git a/java/src/IceInternal/Functional_TwowayCallbackBool.java b/java/src/IceInternal/Functional_TwowayCallbackBool.java index b755ee062ce..b2a3c2a4fd1 100644 --- a/java/src/IceInternal/Functional_TwowayCallbackBool.java +++ b/java/src/IceInternal/Functional_TwowayCallbackBool.java @@ -11,14 +11,14 @@ package IceInternal; public abstract class Functional_TwowayCallbackBool extends Functional_TwowayCallback implements Ice.TwowayCallbackBool { - public Functional_TwowayCallbackBool(Functional_BoolCallback responseCb, + public Functional_TwowayCallbackBool(Functional_BoolCallback responseCb, Functional_GenericCallback1<Ice.Exception> exceptionCb, Functional_BoolCallback sentCb) { super(responseCb != null, exceptionCb, sentCb); this.__responseCb = responseCb; } - + protected Functional_TwowayCallbackBool(boolean userExceptionCb, Functional_BoolCallback responseCb, Functional_GenericCallback1<Ice.Exception> exceptionCb, @@ -28,7 +28,8 @@ public abstract class Functional_TwowayCallbackBool extends Functional_TwowayCal CallbackBase.check(responseCb != null || (userExceptionCb && exceptionCb != null)); this.__responseCb = responseCb; } - + + @Override public void response(boolean arg) { if(__responseCb != null) @@ -36,6 +37,6 @@ public abstract class Functional_TwowayCallbackBool extends Functional_TwowayCal __responseCb.apply(arg); } } - + final private Functional_BoolCallback __responseCb; }; diff --git a/java/src/IceInternal/Functional_TwowayCallbackBoolUE.java b/java/src/IceInternal/Functional_TwowayCallbackBoolUE.java index 513b6f211f8..0c463cd6143 100644 --- a/java/src/IceInternal/Functional_TwowayCallbackBoolUE.java +++ b/java/src/IceInternal/Functional_TwowayCallbackBoolUE.java @@ -13,15 +13,16 @@ public abstract class Functional_TwowayCallbackBoolUE extends Functional_TwowayCallbackBool implements Ice.TwowayCallbackBoolUE { public Functional_TwowayCallbackBoolUE( - Functional_BoolCallback responseCb, - Functional_GenericCallback1<Ice.UserException> userExceptionCb, - Functional_GenericCallback1<Ice.Exception> exceptionCb, + Functional_BoolCallback responseCb, + Functional_GenericCallback1<Ice.UserException> userExceptionCb, + Functional_GenericCallback1<Ice.Exception> exceptionCb, Functional_BoolCallback sentCb) { super(userExceptionCb != null, responseCb, exceptionCb, sentCb); __userExceptionCb = userExceptionCb; } + @Override public void exception(Ice.UserException ex) { if(__userExceptionCb != null) @@ -29,6 +30,6 @@ public abstract class Functional_TwowayCallbackBoolUE __userExceptionCb.apply(ex); } } - + private final Functional_GenericCallback1<Ice.UserException> __userExceptionCb; }; diff --git a/java/src/IceInternal/Functional_TwowayCallbackByte.java b/java/src/IceInternal/Functional_TwowayCallbackByte.java index cd7e9b0d3d1..cf08edcf445 100644 --- a/java/src/IceInternal/Functional_TwowayCallbackByte.java +++ b/java/src/IceInternal/Functional_TwowayCallbackByte.java @@ -11,16 +11,16 @@ package IceInternal; public abstract class Functional_TwowayCallbackByte extends Functional_TwowayCallback implements Ice.TwowayCallbackByte { - public Functional_TwowayCallbackByte(Functional_ByteCallback responseCb, + public Functional_TwowayCallbackByte(Functional_ByteCallback responseCb, Functional_GenericCallback1<Ice.Exception> exceptionCb, Functional_BoolCallback sentCb) { super(responseCb != null, exceptionCb, sentCb); __responseCb = responseCb; } - + protected Functional_TwowayCallbackByte(boolean userExceptionCb, - Functional_ByteCallback responseCb, + Functional_ByteCallback responseCb, Functional_GenericCallback1<Ice.Exception> exceptionCb, Functional_BoolCallback sentCb) { @@ -28,7 +28,8 @@ public abstract class Functional_TwowayCallbackByte extends Functional_TwowayCal CallbackBase.check(responseCb != null || (userExceptionCb && exceptionCb != null)); __responseCb = responseCb; } - + + @Override public void response(byte arg) { if(__responseCb != null) @@ -36,6 +37,6 @@ public abstract class Functional_TwowayCallbackByte extends Functional_TwowayCal __responseCb.apply(arg); } } - + final private Functional_ByteCallback __responseCb; }; diff --git a/java/src/IceInternal/Functional_TwowayCallbackByteUE.java b/java/src/IceInternal/Functional_TwowayCallbackByteUE.java index 18004621033..974606311f5 100644 --- a/java/src/IceInternal/Functional_TwowayCallbackByteUE.java +++ b/java/src/IceInternal/Functional_TwowayCallbackByteUE.java @@ -13,15 +13,16 @@ public abstract class Functional_TwowayCallbackByteUE extends Functional_TwowayCallbackByte implements Ice.TwowayCallbackByteUE { public Functional_TwowayCallbackByteUE( - Functional_ByteCallback responseCb, - Functional_GenericCallback1<Ice.UserException> userExceptionCb, - Functional_GenericCallback1<Ice.Exception> exceptionCb, + Functional_ByteCallback responseCb, + Functional_GenericCallback1<Ice.UserException> userExceptionCb, + Functional_GenericCallback1<Ice.Exception> exceptionCb, Functional_BoolCallback sentCb) { super(userExceptionCb != null, responseCb, exceptionCb, sentCb); __userExceptionCb = userExceptionCb; } + @Override public void exception(Ice.UserException ex) { if(__userExceptionCb != null) @@ -29,6 +30,6 @@ public abstract class Functional_TwowayCallbackByteUE __userExceptionCb.apply(ex); } } - + private final Functional_GenericCallback1<Ice.UserException> __userExceptionCb; }; diff --git a/java/src/IceInternal/Functional_TwowayCallbackDouble.java b/java/src/IceInternal/Functional_TwowayCallbackDouble.java index e580abb91aa..b198b1439ca 100644 --- a/java/src/IceInternal/Functional_TwowayCallbackDouble.java +++ b/java/src/IceInternal/Functional_TwowayCallbackDouble.java @@ -12,16 +12,16 @@ package IceInternal; public abstract class Functional_TwowayCallbackDouble extends Functional_TwowayCallback implements Ice.TwowayCallbackDouble { - public Functional_TwowayCallbackDouble(Functional_DoubleCallback responseCb, + public Functional_TwowayCallbackDouble(Functional_DoubleCallback responseCb, Functional_GenericCallback1<Ice.Exception> exceptionCb, Functional_BoolCallback sentCb) { super(responseCb != null, exceptionCb, sentCb); __responseCb = responseCb; } - + protected Functional_TwowayCallbackDouble(boolean userExceptionCb, - Functional_DoubleCallback responseCb, + Functional_DoubleCallback responseCb, Functional_GenericCallback1<Ice.Exception> exceptionCb, Functional_BoolCallback sentCb) { @@ -29,7 +29,7 @@ public abstract class Functional_TwowayCallbackDouble CallbackBase.check(responseCb != null || (userExceptionCb && exceptionCb != null)); __responseCb = responseCb; } - + public void response(byte arg) { if(__responseCb != null) @@ -37,6 +37,6 @@ public abstract class Functional_TwowayCallbackDouble __responseCb.apply(arg); } } - + final private Functional_DoubleCallback __responseCb; }; diff --git a/java/src/IceInternal/Functional_TwowayCallbackDoubleUE.java b/java/src/IceInternal/Functional_TwowayCallbackDoubleUE.java index c7643b0960d..4ef97e8ad56 100644 --- a/java/src/IceInternal/Functional_TwowayCallbackDoubleUE.java +++ b/java/src/IceInternal/Functional_TwowayCallbackDoubleUE.java @@ -13,15 +13,16 @@ public abstract class Functional_TwowayCallbackDoubleUE extends Functional_TwowayCallbackDouble implements Ice.TwowayCallbackDoubleUE { public Functional_TwowayCallbackDoubleUE( - Functional_DoubleCallback responseCb, - Functional_GenericCallback1<Ice.UserException> userExceptionCb, - Functional_GenericCallback1<Ice.Exception> exceptionCb, + Functional_DoubleCallback responseCb, + Functional_GenericCallback1<Ice.UserException> userExceptionCb, + Functional_GenericCallback1<Ice.Exception> exceptionCb, Functional_BoolCallback sentCb) { super(userExceptionCb != null, responseCb, exceptionCb, sentCb); __userExceptionCb = userExceptionCb; } + @Override public void exception(Ice.UserException ex) { if(__userExceptionCb != null) @@ -29,6 +30,6 @@ public abstract class Functional_TwowayCallbackDoubleUE __userExceptionCb.apply(ex); } } - + private final Functional_GenericCallback1<Ice.UserException> __userExceptionCb; }; diff --git a/java/src/IceInternal/Functional_TwowayCallbackFloat.java b/java/src/IceInternal/Functional_TwowayCallbackFloat.java index a5cc8018e23..6f8b446ee1b 100644 --- a/java/src/IceInternal/Functional_TwowayCallbackFloat.java +++ b/java/src/IceInternal/Functional_TwowayCallbackFloat.java @@ -9,19 +9,19 @@ package IceInternal; -public abstract class Functional_TwowayCallbackFloat +public abstract class Functional_TwowayCallbackFloat extends Functional_TwowayCallback implements Ice.TwowayCallbackFloat { - public Functional_TwowayCallbackFloat(Functional_FloatCallback responseCb, + public Functional_TwowayCallbackFloat(Functional_FloatCallback responseCb, Functional_GenericCallback1<Ice.Exception> exceptionCb, Functional_BoolCallback sentCb) { super(responseCb != null, exceptionCb, sentCb); __responseCb = responseCb; } - + protected Functional_TwowayCallbackFloat(boolean userExceptionCb, - Functional_FloatCallback responseCb, + Functional_FloatCallback responseCb, Functional_GenericCallback1<Ice.Exception> exceptionCb, Functional_BoolCallback sentCb) { @@ -29,7 +29,8 @@ public abstract class Functional_TwowayCallbackFloat CallbackBase.check(responseCb != null || (userExceptionCb && exceptionCb != null)); __responseCb = responseCb; } - + + @Override public void response(float arg) { if(__responseCb != null) @@ -37,6 +38,6 @@ public abstract class Functional_TwowayCallbackFloat __responseCb.apply(arg); } } - + final private Functional_FloatCallback __responseCb; }; diff --git a/java/src/IceInternal/Functional_TwowayCallbackFloatUE.java b/java/src/IceInternal/Functional_TwowayCallbackFloatUE.java index 4df55515af8..0b3d9fb6f4c 100644 --- a/java/src/IceInternal/Functional_TwowayCallbackFloatUE.java +++ b/java/src/IceInternal/Functional_TwowayCallbackFloatUE.java @@ -12,15 +12,16 @@ package IceInternal; public abstract class Functional_TwowayCallbackFloatUE extends Functional_TwowayCallbackFloat implements Ice.TwowayCallbackFloatUE { - public Functional_TwowayCallbackFloatUE(Functional_FloatCallback responseCb, - Functional_GenericCallback1<Ice.UserException> userExceptionCb, - Functional_GenericCallback1<Ice.Exception> exceptionCb, + public Functional_TwowayCallbackFloatUE(Functional_FloatCallback responseCb, + Functional_GenericCallback1<Ice.UserException> userExceptionCb, + Functional_GenericCallback1<Ice.Exception> exceptionCb, Functional_BoolCallback sentCb) { super(userExceptionCb != null, responseCb, exceptionCb, sentCb); __userExceptionCb = userExceptionCb; } + @Override public void exception(Ice.UserException ex) { if(__userExceptionCb != null) @@ -28,6 +29,6 @@ public abstract class Functional_TwowayCallbackFloatUE __userExceptionCb.apply(ex); } } - + private final Functional_GenericCallback1<Ice.UserException> __userExceptionCb; }; diff --git a/java/src/IceInternal/Functional_TwowayCallbackInt.java b/java/src/IceInternal/Functional_TwowayCallbackInt.java index 6724c7fc7c1..82a051a8aa9 100644 --- a/java/src/IceInternal/Functional_TwowayCallbackInt.java +++ b/java/src/IceInternal/Functional_TwowayCallbackInt.java @@ -12,16 +12,16 @@ package IceInternal; public abstract class Functional_TwowayCallbackInt extends Functional_TwowayCallback implements Ice.TwowayCallbackInt { - public Functional_TwowayCallbackInt(Functional_IntCallback responseCb, + public Functional_TwowayCallbackInt(Functional_IntCallback responseCb, Functional_GenericCallback1<Ice.Exception> exceptionCb, Functional_BoolCallback sentCb) { super(responseCb != null, exceptionCb, sentCb); __responseCb = responseCb; } - + protected Functional_TwowayCallbackInt(boolean userExceptionCb, - Functional_IntCallback responseCb, + Functional_IntCallback responseCb, Functional_GenericCallback1<Ice.Exception> exceptionCb, Functional_BoolCallback sentCb) { @@ -29,7 +29,8 @@ public abstract class Functional_TwowayCallbackInt CallbackBase.check(responseCb != null || (userExceptionCb && exceptionCb != null)); __responseCb = responseCb; } - + + @Override public void response(int arg) { if(__responseCb != null) @@ -37,6 +38,6 @@ public abstract class Functional_TwowayCallbackInt __responseCb.apply(arg); } } - + final private Functional_IntCallback __responseCb; }; diff --git a/java/src/IceInternal/Functional_TwowayCallbackIntUE.java b/java/src/IceInternal/Functional_TwowayCallbackIntUE.java index 30693f7361d..be7d88855a3 100644 --- a/java/src/IceInternal/Functional_TwowayCallbackIntUE.java +++ b/java/src/IceInternal/Functional_TwowayCallbackIntUE.java @@ -13,15 +13,16 @@ public abstract class Functional_TwowayCallbackIntUE extends Functional_TwowayCallbackInt implements Ice.TwowayCallbackIntUE { public Functional_TwowayCallbackIntUE( - Functional_IntCallback responseCb, - Functional_GenericCallback1<Ice.UserException> userExceptionCb, - Functional_GenericCallback1<Ice.Exception> exceptionCb, + Functional_IntCallback responseCb, + Functional_GenericCallback1<Ice.UserException> userExceptionCb, + Functional_GenericCallback1<Ice.Exception> exceptionCb, Functional_BoolCallback sentCb) { super(userExceptionCb != null, responseCb, exceptionCb, sentCb); __userExceptionCb = userExceptionCb; } + @Override public void exception(Ice.UserException ex) { if(__userExceptionCb != null) @@ -29,6 +30,6 @@ public abstract class Functional_TwowayCallbackIntUE __userExceptionCb.apply(ex); } } - + private final Functional_GenericCallback1<Ice.UserException> __userExceptionCb; }; diff --git a/java/src/IceInternal/Functional_TwowayCallbackLong.java b/java/src/IceInternal/Functional_TwowayCallbackLong.java index c82268691a4..ae9d08a2f24 100644 --- a/java/src/IceInternal/Functional_TwowayCallbackLong.java +++ b/java/src/IceInternal/Functional_TwowayCallbackLong.java @@ -12,16 +12,16 @@ package IceInternal; public abstract class Functional_TwowayCallbackLong extends Functional_TwowayCallback implements Ice.TwowayCallbackLong { - public Functional_TwowayCallbackLong(Functional_LongCallback responseCb, + public Functional_TwowayCallbackLong(Functional_LongCallback responseCb, Functional_GenericCallback1<Ice.Exception> exceptionCb, Functional_BoolCallback sentCb) { super(responseCb != null, exceptionCb, sentCb); __responseCb = responseCb; } - + protected Functional_TwowayCallbackLong(boolean userExceptionCb, - Functional_LongCallback responseCb, + Functional_LongCallback responseCb, Functional_GenericCallback1<Ice.Exception> exceptionCb, Functional_BoolCallback sentCb) { @@ -29,7 +29,8 @@ public abstract class Functional_TwowayCallbackLong CallbackBase.check(responseCb != null || (userExceptionCb && exceptionCb != null)); __responseCb = responseCb; } - + + @Override public void response(long arg) { if(__responseCb != null) @@ -37,6 +38,6 @@ public abstract class Functional_TwowayCallbackLong __responseCb.apply(arg); } } - + final private Functional_LongCallback __responseCb; }; diff --git a/java/src/IceInternal/Functional_TwowayCallbackLongUE.java b/java/src/IceInternal/Functional_TwowayCallbackLongUE.java index d8d7cd09933..d7db99cfc41 100644 --- a/java/src/IceInternal/Functional_TwowayCallbackLongUE.java +++ b/java/src/IceInternal/Functional_TwowayCallbackLongUE.java @@ -13,15 +13,16 @@ public abstract class Functional_TwowayCallbackLongUE extends Functional_TwowayCallbackLong implements Ice.TwowayCallbackLongUE { public Functional_TwowayCallbackLongUE( - Functional_LongCallback responseCb, - Functional_GenericCallback1<Ice.UserException> userExceptionCb, - Functional_GenericCallback1<Ice.Exception> exceptionCb, + Functional_LongCallback responseCb, + Functional_GenericCallback1<Ice.UserException> userExceptionCb, + Functional_GenericCallback1<Ice.Exception> exceptionCb, Functional_BoolCallback sentCb) { super(responseCb, exceptionCb, sentCb); __userExceptionCb = userExceptionCb; } + @Override public void exception(Ice.UserException ex) { if(__userExceptionCb != null) @@ -29,6 +30,6 @@ public abstract class Functional_TwowayCallbackLongUE __userExceptionCb.apply(ex); } } - + private final Functional_GenericCallback1<Ice.UserException> __userExceptionCb; }; diff --git a/java/src/IceInternal/Functional_TwowayCallbackShort.java b/java/src/IceInternal/Functional_TwowayCallbackShort.java index 7a72c8a1470..6a499cdcc0d 100644 --- a/java/src/IceInternal/Functional_TwowayCallbackShort.java +++ b/java/src/IceInternal/Functional_TwowayCallbackShort.java @@ -12,16 +12,16 @@ package IceInternal; public abstract class Functional_TwowayCallbackShort extends Functional_TwowayCallback implements Ice.TwowayCallbackShort { - public Functional_TwowayCallbackShort(Functional_ShortCallback responseCb, + public Functional_TwowayCallbackShort(Functional_ShortCallback responseCb, Functional_GenericCallback1<Ice.Exception> exceptionCb, Functional_BoolCallback sentCb) { super(responseCb != null, exceptionCb, sentCb); __responseCb = responseCb; } - + protected Functional_TwowayCallbackShort(boolean userExceptionCb, - Functional_ShortCallback responseCb, + Functional_ShortCallback responseCb, Functional_GenericCallback1<Ice.Exception> exceptionCb, Functional_BoolCallback sentCb) { @@ -29,7 +29,8 @@ public abstract class Functional_TwowayCallbackShort CallbackBase.check(responseCb != null || (userExceptionCb && exceptionCb != null)); __responseCb = responseCb; } - + + @Override public void response(short arg) { if(__responseCb != null) @@ -37,6 +38,6 @@ public abstract class Functional_TwowayCallbackShort __responseCb.apply(arg); } } - + final private Functional_ShortCallback __responseCb; }; diff --git a/java/src/IceInternal/Functional_TwowayCallbackShortUE.java b/java/src/IceInternal/Functional_TwowayCallbackShortUE.java index f8bda4114c7..7b896887d89 100644 --- a/java/src/IceInternal/Functional_TwowayCallbackShortUE.java +++ b/java/src/IceInternal/Functional_TwowayCallbackShortUE.java @@ -13,15 +13,16 @@ public abstract class Functional_TwowayCallbackShortUE extends Functional_TwowayCallbackShort implements Ice.TwowayCallbackShortUE { public Functional_TwowayCallbackShortUE( - Functional_ShortCallback responseCb, - Functional_GenericCallback1<Ice.UserException> userExceptionCb, - Functional_GenericCallback1<Ice.Exception> exceptionCb, + Functional_ShortCallback responseCb, + Functional_GenericCallback1<Ice.UserException> userExceptionCb, + Functional_GenericCallback1<Ice.Exception> exceptionCb, Functional_BoolCallback sentCb) { super(responseCb, exceptionCb, sentCb); __userExceptionCb = userExceptionCb; } + @Override public void exception(Ice.UserException ex) { if(__userExceptionCb != null) @@ -29,6 +30,6 @@ public abstract class Functional_TwowayCallbackShortUE __userExceptionCb.apply(ex); } } - + private final Functional_GenericCallback1<Ice.UserException> __userExceptionCb; }; diff --git a/java/src/IceInternal/Functional_TwowayCallbackUE.java b/java/src/IceInternal/Functional_TwowayCallbackUE.java index e0469547199..db8978d2677 100644 --- a/java/src/IceInternal/Functional_TwowayCallbackUE.java +++ b/java/src/IceInternal/Functional_TwowayCallbackUE.java @@ -20,7 +20,8 @@ public abstract class Functional_TwowayCallbackUE extends Functional_TwowayCallb CallbackBase.check(responseCb || (userExceptionCb != null && exceptionCb != null)); __userExceptionCb = userExceptionCb; } - + + @Override public final void exception(Ice.UserException ex) { if(__userExceptionCb != null) @@ -28,6 +29,6 @@ public abstract class Functional_TwowayCallbackUE extends Functional_TwowayCallb __userExceptionCb.apply(ex); } } - + protected final Functional_GenericCallback1<Ice.UserException> __userExceptionCb; } diff --git a/java/src/IceInternal/Functional_TwowayCallbackVoidUE.java b/java/src/IceInternal/Functional_TwowayCallbackVoidUE.java index 53854b6eadf..537333a5808 100644 --- a/java/src/IceInternal/Functional_TwowayCallbackVoidUE.java +++ b/java/src/IceInternal/Functional_TwowayCallbackVoidUE.java @@ -13,15 +13,16 @@ public abstract class Functional_TwowayCallbackVoidUE extends Functional_TwowayCallbackUE implements Ice.TwowayCallbackVoidUE { public Functional_TwowayCallbackVoidUE( - Functional_VoidCallback responseCb, - Functional_GenericCallback1<Ice.UserException> userExceptionCb, - Functional_GenericCallback1<Ice.Exception> exceptionCb, + Functional_VoidCallback responseCb, + Functional_GenericCallback1<Ice.UserException> userExceptionCb, + Functional_GenericCallback1<Ice.Exception> exceptionCb, Functional_BoolCallback sentCb) { super(responseCb != null, userExceptionCb, exceptionCb, sentCb); __responseCb = responseCb; } - + + @Override public void response() { if(__responseCb != null) @@ -29,6 +30,6 @@ public abstract class Functional_TwowayCallbackVoidUE __responseCb.apply(); } } - + private final Functional_VoidCallback __responseCb; }; diff --git a/java/src/IceInternal/HashUtil.java b/java/src/IceInternal/HashUtil.java index 52a3bcb6b84..018c76841b5 100644 --- a/java/src/IceInternal/HashUtil.java +++ b/java/src/IceInternal/HashUtil.java @@ -82,7 +82,7 @@ public final class HashUtil return ((hashCode << 5) + hashCode) ^ java.util.Arrays.hashCode(arr); } - public static int + public static int hashAdd(int hashCode, double[] arr) { return ((hashCode << 5) + hashCode) ^ java.util.Arrays.hashCode(arr); diff --git a/java/src/IceInternal/IPEndpointI.java b/java/src/IceInternal/IPEndpointI.java index 1f00c8099a4..fbea1b8a690 100644 --- a/java/src/IceInternal/IPEndpointI.java +++ b/java/src/IceInternal/IPEndpointI.java @@ -42,6 +42,7 @@ public abstract class IPEndpointI extends EndpointI _hashInitialized = false; } + @Override public void streamWrite(BasicStream s) { s.startWriteEncaps(); @@ -49,20 +50,24 @@ public abstract class IPEndpointI extends EndpointI s.endWriteEncaps(); } + @Override public Ice.EndpointInfo getInfo() { Ice.IPEndpointInfo info = new Ice.IPEndpointInfo() { + @Override public short type() { return IPEndpointI.this.type(); } + @Override public boolean datagram() { return IPEndpointI.this.datagram(); } + @Override public boolean secure() { return IPEndpointI.this.secure(); @@ -72,21 +77,25 @@ public abstract class IPEndpointI extends EndpointI return info; } + @Override public short type() { return _instance.type(); } + @Override public String protocol() { return _instance.protocol(); } + @Override public String connectionId() { return _connectionId; } + @Override public EndpointI connectionId(String connectionId) { if(connectionId.equals(_connectionId)) @@ -99,16 +108,19 @@ public abstract class IPEndpointI extends EndpointI } } + @Override public java.util.List<Connector> connectors(Ice.EndpointSelectionType selType) { return _instance.resolve(_host, _port, selType, this); } + @Override public void connectors_async(Ice.EndpointSelectionType selType, EndpointI_connectors callback) { _instance.resolve(_host, _port, selType, this, callback); } + @Override public java.util.List<EndpointI> expand() { java.util.List<EndpointI> endps = new java.util.ArrayList<EndpointI>(); @@ -127,6 +139,7 @@ public abstract class IPEndpointI extends EndpointI return endps; } + @Override public boolean equivalent(EndpointI endpoint) { if(!(endpoint instanceof IPEndpointI)) @@ -149,6 +162,7 @@ public abstract class IPEndpointI extends EndpointI return connectors; } + @Override synchronized public int hashCode() { if(!_hashInitialized) @@ -161,6 +175,7 @@ public abstract class IPEndpointI extends EndpointI return _hashValue; } + @Override public String options() { // @@ -197,6 +212,7 @@ public abstract class IPEndpointI extends EndpointI return s; } + @Override public int compareTo(EndpointI obj) // From java.lang.Comparable { if(!(obj instanceof IPEndpointI)) @@ -308,6 +324,7 @@ public abstract class IPEndpointI extends EndpointI } } + @Override protected boolean checkOption(String option, String argument, String endpoint) { if(option.equals("-h")) diff --git a/java/src/IceInternal/Incoming.java b/java/src/IceInternal/Incoming.java index f8c3e0e9d64..a9b3faa8b5c 100644 --- a/java/src/IceInternal/Incoming.java +++ b/java/src/IceInternal/Incoming.java @@ -25,7 +25,7 @@ final public class Incoming extends IncomingBase implements Ice.Request if(response) { _os.writeBlob(IceInternal.Protocol.replyHdr); - + // // Add the request ID. // @@ -33,6 +33,7 @@ final public class Incoming extends IncomingBase implements Ice.Request } } + @Override public Ice.Current getCurrent() { @@ -42,13 +43,14 @@ final public class Incoming extends IncomingBase implements Ice.Request // // These functions allow this object to be reused, rather than reallocated. // + @Override public void - reset(Instance instance, ResponseHandler handler, Ice.ConnectionI connection, Ice.ObjectAdapter adapter, + reset(Instance instance, ResponseHandler handler, Ice.ConnectionI connection, Ice.ObjectAdapter adapter, boolean response, byte compress, int requestId) { _cb = null; _inParamPos = -1; - + super.reset(instance, handler, connection, adapter, response, compress, requestId); // @@ -57,7 +59,7 @@ final public class Incoming extends IncomingBase implements Ice.Request if(response) { _os.writeBlob(IceInternal.Protocol.replyHdr); - + // // Add the request ID. // @@ -65,6 +67,7 @@ final public class Incoming extends IncomingBase implements Ice.Request } } + @Override public void reclaim() { @@ -225,7 +228,7 @@ final public class Incoming extends IncomingBase implements Ice.Request Thread.currentThread().setContextClassLoader(null); } } - + if(_locator != null && !__servantLocatorFinished()) { return; @@ -238,7 +241,7 @@ final public class Incoming extends IncomingBase implements Ice.Request // the next batch request if dispatching batch requests. // _is.skipEncaps(); - + if(servantManager != null && servantManager.hasServant(_current.id)) { throw new Ice.FacetNotExistException(_current.id, _current.facet, _current.operation); @@ -258,7 +261,7 @@ final public class Incoming extends IncomingBase implements Ice.Request __handleException(ex); return; } - + // // Don't put the code below into the try block above. Exceptions // in the code below are considered fatal, and must propagate to @@ -295,10 +298,10 @@ final public class Incoming extends IncomingBase implements Ice.Request { _interceptorAsyncCallbackList = new java.util.LinkedList<Ice.DispatchInterceptorAsyncCallback>(); } - + _interceptorAsyncCallbackList.addFirst(cb); } - + public final void pop() { @@ -306,7 +309,7 @@ final public class Incoming extends IncomingBase implements Ice.Request _interceptorAsyncCallbackList.removeFirst(); } - public final void + public final void startOver() { if(_inParamPos == -1) @@ -319,14 +322,14 @@ final public class Incoming extends IncomingBase implements Ice.Request else { killAsync(); - + // // Let's rewind _is and clean-up _os // _is.pos(_inParamPos); if(_response) { - _os.resize(Protocol.headerSize + 4, false); + _os.resize(Protocol.headerSize + 4, false); } } } @@ -357,7 +360,7 @@ final public class Incoming extends IncomingBase implements Ice.Request _current.encoding = _is.startReadEncaps(); return _is; } - + public final void endReadParams() { @@ -384,8 +387,8 @@ final public class Incoming extends IncomingBase implements Ice.Request assert _cb == null; _cb = cb; } - - final boolean + + final boolean isRetriable() { return _inParamPos != -1; diff --git a/java/src/IceInternal/IncomingAsync.java b/java/src/IceInternal/IncomingAsync.java index 2ab2d0fc335..c8ea7cbf6e7 100644 --- a/java/src/IceInternal/IncomingAsync.java +++ b/java/src/IceInternal/IncomingAsync.java @@ -24,6 +24,7 @@ public class IncomingAsync extends IncomingBase implements Ice.AMDCallback } } + @Override public void ice_exception(java.lang.Exception ex) { @@ -52,7 +53,7 @@ public class IncomingAsync extends IncomingBase implements Ice.AMDCallback { return; } - + synchronized(this) { if(!_active) diff --git a/java/src/IceInternal/IncomingBase.java b/java/src/IceInternal/IncomingBase.java index b29c08a6fae..e02c15565c6 100644 --- a/java/src/IceInternal/IncomingBase.java +++ b/java/src/IceInternal/IncomingBase.java @@ -12,7 +12,7 @@ package IceInternal; public class IncomingBase { protected - IncomingBase(Instance instance, ResponseHandler handler, Ice.ConnectionI connection, Ice.ObjectAdapter adapter, + IncomingBase(Instance instance, ResponseHandler handler, Ice.ConnectionI connection, Ice.ObjectAdapter adapter, boolean response, byte compress, int requestId) { _instance = instance; @@ -100,18 +100,18 @@ public class IncomingBase _os.writeByte((byte)0); _os.startWriteEncaps(_current.encoding, format); } - + // // We still return the stream even if no response is expected. The // servant code might still write some out parameters if for // example a method with out parameters somehow and erroneously - // invoked as oneway (or if the invocation is invoked on a + // invoked as oneway (or if the invocation is invoked on a // blobject and the blobject erroneously writes a response). // return _os; } - - public void + + public void __endWriteParams(boolean ok) { if(!ok && _observer != null) @@ -129,7 +129,7 @@ public class IncomingBase } } - public void + public void __writeEmptyParams() { if(_response) @@ -141,7 +141,7 @@ public class IncomingBase } } - public void + public void __writeParamEncaps(byte[] v, boolean ok) { if(!ok && _observer != null) @@ -177,7 +177,7 @@ public class IncomingBase // These functions allow this object to be reused, rather than reallocated. // public void - reset(Instance instance, ResponseHandler handler, Ice.ConnectionI connection, Ice.ObjectAdapter adapter, + reset(Instance instance, ResponseHandler handler, Ice.ConnectionI connection, Ice.ObjectAdapter adapter, boolean response, byte compress, int requestId) { _instance = instance; @@ -344,7 +344,7 @@ public class IncomingBase { __warning(ex); } - + if(_observer != null) { _observer.failed(ex.ice_name()); diff --git a/java/src/IceInternal/IncomingConnectionFactory.java b/java/src/IceInternal/IncomingConnectionFactory.java index 59c63fb3b2a..683d619875c 100644 --- a/java/src/IceInternal/IncomingConnectionFactory.java +++ b/java/src/IceInternal/IncomingConnectionFactory.java @@ -185,6 +185,7 @@ public final class IncomingConnectionFactory extends EventHandler implements Ice // Operations from EventHandler. // + @Override public void message(ThreadPoolCurrent current) { @@ -282,6 +283,7 @@ public final class IncomingConnectionFactory extends EventHandler implements Ice connection.start(this); } + @Override public synchronized void finished(ThreadPoolCurrent current) { @@ -289,6 +291,7 @@ public final class IncomingConnectionFactory extends EventHandler implements Ice setState(StateFinished); } + @Override public synchronized String toString() { @@ -301,6 +304,7 @@ public final class IncomingConnectionFactory extends EventHandler implements Ice return _acceptor.toString(); } + @Override public java.nio.channels.SelectableChannel fd() { @@ -311,6 +315,7 @@ public final class IncomingConnectionFactory extends EventHandler implements Ice // // Operations from ConnectionI.StartCallback // + @Override public synchronized void connectionStartCompleted(Ice.ConnectionI connection) { @@ -324,6 +329,7 @@ public final class IncomingConnectionFactory extends EventHandler implements Ice } } + @Override public synchronized void connectionStartFailed(Ice.ConnectionI connection, Ice.LocalException ex) { @@ -426,6 +432,7 @@ public final class IncomingConnectionFactory extends EventHandler implements Ice } } + @Override protected synchronized void finalize() throws Throwable @@ -474,7 +481,7 @@ public final class IncomingConnectionFactory extends EventHandler implements Ice s.append(" connections at "); s.append(_acceptor.toString()); _instance.initializationData().logger.trace(_instance.traceLevels().networkCat, s.toString()); - } + } ((Ice.ObjectAdapterI)_adapter).getThreadPool().register(this, SocketOperation.Read); } @@ -500,7 +507,7 @@ public final class IncomingConnectionFactory extends EventHandler implements Ice s.append(" connections at "); s.append(_acceptor.toString()); _instance.initializationData().logger.trace(_instance.traceLevels().networkCat, s.toString()); - } + } ((Ice.ObjectAdapterI)_adapter).getThreadPool().unregister(this, SocketOperation.Read); } @@ -552,7 +559,7 @@ public final class IncomingConnectionFactory extends EventHandler implements Ice } private final Instance _instance; - private final FactoryACMMonitor _monitor; + private final FactoryACMMonitor _monitor; private Acceptor _acceptor; private Transceiver _transceiver; diff --git a/java/src/IceInternal/InputStreamWrapper.java b/java/src/IceInternal/InputStreamWrapper.java index 17fe7435768..12654f60771 100644 --- a/java/src/IceInternal/InputStreamWrapper.java +++ b/java/src/IceInternal/InputStreamWrapper.java @@ -25,6 +25,7 @@ public class InputStreamWrapper extends java.io.InputStream _markPos = 0; } + @Override public int read() throws java.io.IOException @@ -39,6 +40,7 @@ public class InputStreamWrapper extends java.io.InputStream } } + @Override public int read(byte[] b) throws java.io.IOException @@ -46,6 +48,7 @@ public class InputStreamWrapper extends java.io.InputStream return read(b, 0, b.length); } + @Override public int read(byte[] b, int offset, int count) throws java.io.IOException @@ -61,18 +64,21 @@ public class InputStreamWrapper extends java.io.InputStream return count; } + @Override public int available() { return _s.getBuffer().b.remaining(); } + @Override public void mark(int readlimit) { _markPos = _s.pos(); } + @Override public void reset() throws java.io.IOException @@ -80,12 +86,14 @@ public class InputStreamWrapper extends java.io.InputStream _s.pos(_markPos); } + @Override public boolean markSupported() { return true; } + @Override public void close() throws java.io.IOException diff --git a/java/src/IceInternal/Instance.java b/java/src/IceInternal/Instance.java index 95f8d33481e..8eb6de0f210 100644 --- a/java/src/IceInternal/Instance.java +++ b/java/src/IceInternal/Instance.java @@ -709,7 +709,7 @@ public final class Instance _clientACM = new ACMConfig(_initData.properties, _initData.logger, "Ice.ACM.Client", - new ACMConfig(_initData.properties, _initData.logger, "Ice.ACM", + new ACMConfig(_initData.properties, _initData.logger, "Ice.ACM", new ACMConfig(false))); _serverACM = new ACMConfig(_initData.properties, @@ -717,7 +717,7 @@ public final class Instance "Ice.ACM.Server", new ACMConfig(_initData.properties, _initData.logger, "Ice.ACM", new ACMConfig(true))); - + { final int defaultMessageSizeMax = 1024; int num = _initData.properties.getPropertyAsIntWithDefault("Ice.MessageSizeMax", defaultMessageSizeMax); @@ -830,7 +830,7 @@ public final class Instance // props.addUpdateCallback(admin); } - else + else { _observer = _initData.observer; } @@ -842,6 +842,7 @@ public final class Instance } } + @Override protected synchronized void finalize() throws Throwable @@ -900,6 +901,7 @@ public final class Instance new java.util.concurrent.ScheduledThreadPoolExecutor(1, new java.util.concurrent.ThreadFactory() { + @Override public Thread newThread(Runnable r) { Thread t = new Thread(r); @@ -908,7 +910,7 @@ public final class Instance final int priority = Util.getThreadPriorityProperty( initializationData().properties, "Ice"); t.setPriority(priority); - } + } String threadName = initializationData().properties.getProperty("Ice.ProgramName"); if(threadName.length() > 0) @@ -1082,7 +1084,7 @@ public final class Instance _timer.shutdown(); // Once we support interrupt we can use shutdownNow. //_timer.shutdownNow(); - + _timer = null; } diff --git a/java/src/IceInternal/InvocationObserverI.java b/java/src/IceInternal/InvocationObserverI.java index 6745c281ef8..8c9ffc57d32 100644 --- a/java/src/IceInternal/InvocationObserverI.java +++ b/java/src/IceInternal/InvocationObserverI.java @@ -11,14 +11,14 @@ package IceInternal; import IceMX.*; -public class InvocationObserverI - extends IceMX.ObserverWithDelegate<IceMX.InvocationMetrics, Ice.Instrumentation.InvocationObserver> +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 { @@ -35,8 +35,8 @@ public class InvocationObserverI } } }; - - RemoteInvocationHelper(Ice.ConnectionInfo con, Ice.Endpoint endpt, int requestId, int size) + + RemoteInvocationHelper(Ice.ConnectionInfo con, Ice.Endpoint endpt, int requestId, int size) { super(_attributes); _connectionInfo = con; @@ -45,7 +45,8 @@ public class InvocationObserverI _size = size; } - public void + @Override + public void initMetrics(RemoteMetrics v) { v.size += _size; @@ -71,7 +72,7 @@ public class InvocationObserverI return _requestId; } - public String + public String getParent() { if(_connectionInfo.adapterName != null && !_connectionInfo.adapterName.isEmpty()) @@ -83,13 +84,13 @@ public class InvocationObserverI return "Communicator"; } } - + public Ice.ConnectionInfo getConnectionInfo() { return _connectionInfo; } - + public Ice.Endpoint getEndpoint() { @@ -117,7 +118,7 @@ public class InvocationObserverI static public final class CollocatedInvocationHelper extends MetricsHelper<CollocatedMetrics> { static private final AttributeResolver _attributes = new AttributeResolver() - { + { { try { @@ -133,8 +134,8 @@ public class InvocationObserverI } } }; - - CollocatedInvocationHelper(Ice.ObjectAdapter adapter, int requestId, int size) + + CollocatedInvocationHelper(Ice.ObjectAdapter adapter, int requestId, int size) { super(_attributes); _id = adapter.getName(); @@ -142,7 +143,8 @@ public class InvocationObserverI _size = size; } - public void + @Override + public void initMetrics(CollocatedMetrics v) { v.size += _size; @@ -160,7 +162,7 @@ public class InvocationObserverI return _requestId; } - public String + public String getParent() { return "Communicator"; @@ -171,6 +173,7 @@ public class InvocationObserverI final private String _id; }; + @Override public void userException() { @@ -181,6 +184,7 @@ public class InvocationObserverI } } + @Override public void retried() { @@ -190,8 +194,9 @@ public class InvocationObserverI _delegate.retried(); } } - - public Ice.Instrumentation.RemoteObserver + + @Override + public Ice.Instrumentation.RemoteObserver getRemoteObserver(Ice.ConnectionInfo con, Ice.Endpoint edpt, int requestId, int sz) { Ice.Instrumentation.RemoteObserver delegate = null; @@ -199,13 +204,14 @@ public class InvocationObserverI { delegate = _delegate.getRemoteObserver(con, edpt, requestId, sz); } - return (Ice.Instrumentation.RemoteObserver)getObserver("Remote", + return getObserver("Remote", new RemoteInvocationHelper(con, edpt, requestId, sz), - RemoteMetrics.class, + RemoteMetrics.class, RemoteObserverI.class, delegate); } + @Override public Ice.Instrumentation.CollocatedObserver getCollocatedObserver(Ice.ObjectAdapter adapter, int requestId, int sz) { @@ -214,16 +220,17 @@ public class InvocationObserverI { delegate = _delegate.getCollocatedObserver(adapter, requestId, sz); } - return (Ice.Instrumentation.CollocatedObserver)getObserver( + return getObserver( "Collocated", new CollocatedInvocationHelper(adapter, requestId, sz), - CollocatedMetrics.class, + CollocatedMetrics.class, CollocatedObserverI.class, delegate); } final MetricsUpdate<InvocationMetrics> _incrementRetry = new MetricsUpdate<InvocationMetrics>() { + @Override public void update(InvocationMetrics v) { @@ -233,6 +240,7 @@ public class InvocationObserverI final MetricsUpdate<InvocationMetrics> _userException = new MetricsUpdate<InvocationMetrics>() { + @Override public void update(InvocationMetrics v) { diff --git a/java/src/IceInternal/ListPatcher.java b/java/src/IceInternal/ListPatcher.java index a181482669a..9b44590cc9d 100644 --- a/java/src/IceInternal/ListPatcher.java +++ b/java/src/IceInternal/ListPatcher.java @@ -20,6 +20,7 @@ public class ListPatcher<T> implements Patcher, Ice.ReadObjectCallback _index = index; } + @Override public void patch(Ice.Object v) { @@ -43,12 +44,14 @@ public class ListPatcher<T> implements Patcher, Ice.ReadObjectCallback _list.set(_index, _cls.cast(v)); } + @Override public String type() { return _type; } + @Override public void invoke(Ice.Object v) { diff --git a/java/src/IceInternal/LocatorInfo.java b/java/src/IceInternal/LocatorInfo.java index a6c268e897c..5afb2a3170a 100644 --- a/java/src/IceInternal/LocatorInfo.java +++ b/java/src/IceInternal/LocatorInfo.java @@ -19,7 +19,7 @@ public final class LocatorInfo private static class RequestCallback { - public void + public void response(LocatorInfo locatorInfo, Ice.ObjectPrx proxy) { EndpointI[] endpoints = null; @@ -42,7 +42,7 @@ public final class LocatorInfo { // // We're resolving the endpoints of a well-known object and the proxy returned - // by the locator is an indirect proxy. We now need to resolve the endpoints + // by the locator is an indirect proxy. We now need to resolve the endpoints // of this indirect proxy. // locatorInfo.getEndpoints(r, _ref, _ttl, _callback); @@ -60,7 +60,7 @@ public final class LocatorInfo } } - public void + public void exception(LocatorInfo locatorInfo, Exception exc) { try @@ -90,7 +90,7 @@ public final class LocatorInfo private abstract class Request { - synchronized public void + synchronized public void addCallback(Reference ref, Reference wellKnownRef, int ttl, GetEndpointsCallback cb) { RequestCallback callback = new RequestCallback(ref, ttl, cb); @@ -116,7 +116,7 @@ public final class LocatorInfo } } } - + synchronized EndpointI[] getEndpoints(Reference ref, Reference wellKnownRef, int ttl, Ice.BooleanHolder cached) { @@ -131,7 +131,7 @@ public final class LocatorInfo _sent = true; send(); } - + while(!_response && _exception == null) { try @@ -143,12 +143,12 @@ public final class LocatorInfo } } } - + if(_exception != null) { _locatorInfo.getEndpointsException(ref, _exception); // This throws. } - + assert(_response); EndpointI[] endpoints = null; if(_proxy != null) @@ -162,13 +162,13 @@ public final class LocatorInfo { // // We're resolving the endpoints of a well-known object and the proxy returned - // by the locator is an indirect proxy. We now need to resolve the endpoints + // by the locator is an indirect proxy. We now need to resolve the endpoints // of this indirect proxy. // return _locatorInfo.getEndpoints(r, ref, ttl, cached); } } - + cached.value = false; if(_ref.getInstance().traceLevels().location >= 1) { @@ -176,16 +176,16 @@ public final class LocatorInfo } return endpoints == null ? new EndpointI[0] : endpoints; } - + Request(LocatorInfo locatorInfo, Reference ref) { _locatorInfo = locatorInfo; - _ref = ref; - _sent = false; + _ref = ref; + _sent = false; _response = false; } - synchronized protected void + synchronized protected void response(Ice.ObjectPrx proxy) { _locatorInfo.finishRequest(_ref, _wellKnownRefs, proxy, false); @@ -198,7 +198,7 @@ public final class LocatorInfo notifyAll(); } - protected void + protected void exception(Exception ex) { synchronized(this) @@ -234,7 +234,8 @@ public final class LocatorInfo assert(reference.isWellKnown()); } - protected void + @Override + protected void send() { try @@ -243,18 +244,21 @@ public final class LocatorInfo _ref.getIdentity(), new Ice.Callback_Locator_findObjectById() { + @Override public void response(Ice.ObjectPrx proxy) { ObjectRequest.this.response(proxy); } - + + @Override public void exception(Ice.UserException ex) { ObjectRequest.this.exception(ex); } - + + @Override public void exception(Ice.LocalException ex) { @@ -276,7 +280,8 @@ public final class LocatorInfo super(locatorInfo, reference); assert(reference.isIndirect()); } - + + @Override protected void send() { @@ -286,18 +291,21 @@ public final class LocatorInfo _ref.getAdapterId(), new Ice.Callback_Locator_findAdapterById() { + @Override public void response(Ice.ObjectPrx proxy) { AdapterRequest.this.response(proxy); } - + + @Override public void exception(Ice.UserException ex) { AdapterRequest.this.exception(ex); } - + + @Override public void exception(Ice.LocalException ex) { @@ -326,6 +334,7 @@ public final class LocatorInfo _table.clear(); } + @Override public boolean equals(java.lang.Object obj) { @@ -342,6 +351,7 @@ public final class LocatorInfo return false; } + @Override public int hashCode() { @@ -371,7 +381,7 @@ public final class LocatorInfo // // Do not make locator calls from within sync. // - Ice.LocatorRegistryPrx locatorRegistry = (Ice.LocatorRegistryPrx)_locator.getRegistry(); + Ice.LocatorRegistryPrx locatorRegistry = _locator.getRegistry(); if(locatorRegistry == null) { return null; @@ -428,7 +438,7 @@ public final class LocatorInfo return getObjectRequest(ref).getEndpoints(ref, null, ttl, cached); } } - + if(!r.isIndirect()) { endpoints = r.getEndpoints(); @@ -438,7 +448,7 @@ public final class LocatorInfo return getEndpoints(r, ref, ttl, cached); } } - + assert(endpoints != null); cached.value = true; if(ref.getInstance().traceLevels().location >= 1) @@ -757,20 +767,20 @@ public final class LocatorInfo _table.removeObjectReference(r.getIdentity()); } } - + if(!ref.isWellKnown()) { if(proxy != null && !((Ice.ObjectPrxHelperBase)proxy).__reference().isIndirect()) { // Cache the adapter endpoints. - _table.addAdapterEndpoints(ref.getAdapterId(), + _table.addAdapterEndpoints(ref.getAdapterId(), ((Ice.ObjectPrxHelperBase)proxy).__reference().getEndpoints()); } else if(notRegistered) // If the adapter isn't registered anymore, remove it from the cache. { _table.removeAdapterEndpoints(ref.getAdapterId()); } - + synchronized(this) { assert(_adapterRequests.get(ref.getAdapterId()) != null); @@ -779,7 +789,7 @@ public final class LocatorInfo } else { - if(proxy != null && !((Ice.ObjectPrxHelperBase)proxy).__reference().isWellKnown()) + if(proxy != null && !((Ice.ObjectPrxHelperBase)proxy).__reference().isWellKnown()) { // Cache the well-known object reference. _table.addObjectReference(ref.getIdentity(), ((Ice.ObjectPrxHelperBase)proxy).__reference()); @@ -796,7 +806,7 @@ public final class LocatorInfo } } } - + private final Ice.LocatorPrx _locator; private Ice.LocatorRegistryPrx _locatorRegistry; private final LocatorTable _table; diff --git a/java/src/IceInternal/LocatorManager.java b/java/src/IceInternal/LocatorManager.java index 166c63a1406..0e651b5935c 100644 --- a/java/src/IceInternal/LocatorManager.java +++ b/java/src/IceInternal/LocatorManager.java @@ -13,7 +13,8 @@ public final class LocatorManager { static private class LocatorKey implements Cloneable { - public boolean + @Override + public boolean equals(Object o) { assert(o instanceof LocatorKey); @@ -29,6 +30,7 @@ public final class LocatorManager return true; } + @Override public int hashCode() { @@ -38,6 +40,7 @@ public final class LocatorManager return h; } + @Override public java.lang.Object clone() { @@ -52,7 +55,7 @@ public final class LocatorManager } return o; } - + LocatorKey set(Ice.LocatorPrx locator) { Reference r = ((Ice.ObjectPrxHelperBase)locator).__reference(); diff --git a/java/src/IceInternal/MetricsAdminI.java b/java/src/IceInternal/MetricsAdminI.java index f67be46dcd2..3cb4833d0be 100644 --- a/java/src/IceInternal/MetricsAdminI.java +++ b/java/src/IceInternal/MetricsAdminI.java @@ -43,7 +43,7 @@ public class MetricsAdminI extends IceMX._MetricsAdminDisp implements Ice.Proper unknownProps.add(prop); } } - + if(unknownProps.size() != 0 && properties.getPropertyAsIntWithDefault("Ice.Warn.UnknownProperties", 1) > 0) { StringBuffer message = new StringBuffer("found unknown IceMX properties for `"); @@ -57,7 +57,7 @@ public class MetricsAdminI extends IceMX._MetricsAdminDisp implements Ice.Proper Ice.Util.getProcessLogger().warning(message.toString()); } } - + static class MetricsMapFactory<T extends IceMX.Metrics> { public MetricsMapFactory(Runnable updater, Class<T> cl) @@ -87,7 +87,7 @@ public class MetricsAdminI extends IceMX._MetricsAdminDisp implements Ice.Proper final private Runnable _updater; final private Class<T> _class; - final private java.util.Map<String, MetricsMap.SubMapFactory<?>> _subMaps = + final private java.util.Map<String, MetricsMap.SubMapFactory<?>> _subMaps = new java.util.HashMap<String, MetricsMap.SubMapFactory<?>>(); }; @@ -115,20 +115,20 @@ public class MetricsAdminI extends IceMX._MetricsAdminDisp implements Ice.Proper { viewName = viewName.substring(0, dotPos); } - + if(views.containsKey(viewName) || _disabledViews.contains(viewName)) { continue; // View already configured. } - + validateProperties(viewsPrefix + viewName + ".", _properties); - + if(_properties.getPropertyAsIntWithDefault(viewsPrefix + viewName + ".Disabled", 0) > 0) { _disabledViews.add(viewName); continue; // The view is disabled } - + // // Create the view or update it. // @@ -150,7 +150,7 @@ public class MetricsAdminI extends IceMX._MetricsAdminDisp implements Ice.Proper java.util.Map<String, MetricsViewI> tmp = _views; _views = views; views = tmp; - + // // Go through removed views to collect maps to update. // @@ -165,7 +165,7 @@ public class MetricsAdminI extends IceMX._MetricsAdminDisp implements Ice.Proper } } } - + // // Call the updaters to update the maps. // @@ -175,14 +175,16 @@ public class MetricsAdminI extends IceMX._MetricsAdminDisp implements Ice.Proper } } - synchronized public String[] + @Override + synchronized public String[] getMetricsViewNames(Ice.StringSeqHolder holder, Ice.Current current) { holder.value = _disabledViews.toArray(new String[_disabledViews.size()]); return _views.keySet().toArray(new String[_views.size()]); } - public void + @Override + public void enableMetricsView(String name, Ice.Current current) throws IceMX.UnknownMetricsView { @@ -193,8 +195,9 @@ public class MetricsAdminI extends IceMX._MetricsAdminDisp implements Ice.Proper } updateViews(); } - - public void + + @Override + public void disableMetricsView(String name, Ice.Current current) throws IceMX.UnknownMetricsView { @@ -205,8 +208,9 @@ public class MetricsAdminI extends IceMX._MetricsAdminDisp implements Ice.Proper } updateViews(); } - - synchronized public java.util.Map<String, IceMX.Metrics[]> + + @Override + synchronized public java.util.Map<String, IceMX.Metrics[]> getMetricsView(String viewName, Ice.LongHolder holder, Ice.Current current) throws IceMX.UnknownMetricsView { @@ -219,7 +223,8 @@ public class MetricsAdminI extends IceMX._MetricsAdminDisp implements Ice.Proper return new java.util.HashMap<String, IceMX.Metrics[]>(); } - synchronized public IceMX.MetricsFailures[] + @Override + synchronized public IceMX.MetricsFailures[] getMapMetricsFailures(String viewName, String mapName, Ice.Current current) throws IceMX.UnknownMetricsView { @@ -231,7 +236,8 @@ public class MetricsAdminI extends IceMX._MetricsAdminDisp implements Ice.Proper return new IceMX.MetricsFailures[0]; } - synchronized public IceMX.MetricsFailures + @Override + synchronized public IceMX.MetricsFailures getMetricsFailures(String viewName, String mapName, String id, Ice.Current current) throws IceMX.UnknownMetricsView { @@ -282,7 +288,7 @@ public class MetricsAdminI extends IceMX._MetricsAdminDisp implements Ice.Proper } } - public void + public void unregisterMap(String mapName) { boolean updated; @@ -317,7 +323,7 @@ public class MetricsAdminI extends IceMX._MetricsAdminDisp implements Ice.Proper return maps; } - public Ice.Logger + public Ice.Logger getLogger() { return _logger; @@ -328,8 +334,9 @@ public class MetricsAdminI extends IceMX._MetricsAdminDisp implements Ice.Proper { _properties = properties; } - - public void + + @Override + public void updated(java.util.Map<String, String> props) { for(java.util.Map.Entry<String, String> e : props.entrySet()) @@ -343,7 +350,7 @@ public class MetricsAdminI extends IceMX._MetricsAdminDisp implements Ice.Proper } catch(Exception ex) { - _logger.warning("unexpected exception while updating metrics view configuration:\n" + + _logger.warning("unexpected exception while updating metrics view configuration:\n" + ex.toString()); } return; @@ -351,7 +358,7 @@ public class MetricsAdminI extends IceMX._MetricsAdminDisp implements Ice.Proper } } - private MetricsViewI + private MetricsViewI getMetricsView(String name) throws IceMX.UnknownMetricsView { @@ -366,7 +373,7 @@ public class MetricsAdminI extends IceMX._MetricsAdminDisp implements Ice.Proper } return view; } - + private boolean addOrUpdateMap(String mapName, MetricsMapFactory factory) { @@ -391,7 +398,7 @@ public class MetricsAdminI extends IceMX._MetricsAdminDisp implements Ice.Proper private Ice.Properties _properties; final private Ice.Logger _logger; - final private java.util.Map<String, MetricsMapFactory<?>> _factories = + final private java.util.Map<String, MetricsMapFactory<?>> _factories = new java.util.HashMap<String, MetricsMapFactory<?>>(); private java.util.Map<String, MetricsViewI> _views = new java.util.HashMap<String, MetricsViewI>(); diff --git a/java/src/IceInternal/MetricsMap.java b/java/src/IceInternal/MetricsMap.java index 604ed218486..ea798edd6ee 100644 --- a/java/src/IceInternal/MetricsMap.java +++ b/java/src/IceInternal/MetricsMap.java @@ -26,13 +26,13 @@ public class MetricsMap<T extends IceMX.Metrics> ++_object.failures; if(_failures == null) { - _failures = new java.util.HashMap<String, Integer>(); + _failures = new java.util.HashMap<String, Integer>(); } Integer count = _failures.get(exceptionName); _failures.put(exceptionName, new Integer(count == null ? 1 : count + 1)); } } - + @SuppressWarnings("unchecked") public <S extends IceMX.Metrics> MetricsMap<S>.Entry getMatching(String mapName, IceMX.MetricsHelper<S> helper, Class<S> cl) @@ -58,7 +58,7 @@ public class MetricsMap<T extends IceMX.Metrics> return m.getMatching(helper); } - public void + public void detach(long lifetime) { synchronized(MetricsMap.this) @@ -86,7 +86,7 @@ public class MetricsMap<T extends IceMX.Metrics> return MetricsMap.this; } - private IceMX.MetricsFailures + private IceMX.MetricsFailures getFailures() { if(_failures == null) @@ -107,12 +107,13 @@ public class MetricsMap<T extends IceMX.Metrics> helper.initMetrics(_object); } - private boolean + private boolean isDetached() { return _object.current == 0; } + @Override @SuppressWarnings("unchecked") public IceMX.Metrics clone() @@ -135,20 +136,20 @@ public class MetricsMap<T extends IceMX.Metrics> static class SubMap<S extends IceMX.Metrics> { - public + public SubMap(MetricsMap<S> map, java.lang.reflect.Field field) { _map = map; _field = field; } - public MetricsMap<S>.Entry + public MetricsMap<S>.Entry getMatching(IceMX.MetricsHelper<S> helper) { return _map.getMatching(helper, null); } - public void + public void addSubMapToMetrics(IceMX.Metrics metrics) { try @@ -160,7 +161,7 @@ public class MetricsMap<T extends IceMX.Metrics> assert(false); } } - + final private MetricsMap<S> _map; final private java.lang.reflect.Field _field; }; @@ -205,7 +206,7 @@ public class MetricsMap<T extends IceMX.Metrics> { MetricsAdminI.validateProperties(mapPrefix, props); _properties = props.getPropertiesForPrefix(mapPrefix); - + _retain = props.getPropertyAsIntWithDefault(mapPrefix + "RetainDetached", 10); _accept = parseRule(props, mapPrefix + "Accept"); _reject = parseRule(props, mapPrefix + "Reject"); @@ -222,7 +223,7 @@ public class MetricsMap<T extends IceMX.Metrics> { _groupByAttributes.add(""); } - + for(char p : groupBy.toCharArray()) { boolean isAlphaNum = Character.isLetter(p) || Character.isDigit(p) || p == '.'; @@ -243,7 +244,7 @@ public class MetricsMap<T extends IceMX.Metrics> v += p; } } - + if(attribute) { _groupByAttributes.add(v); @@ -284,7 +285,7 @@ public class MetricsMap<T extends IceMX.Metrics> _subMaps = null; } } - + MetricsMap(MetricsMap<T> map) { _properties = map._properties; @@ -314,7 +315,7 @@ public class MetricsMap<T extends IceMX.Metrics> } return metrics; } - + synchronized IceMX.MetricsFailures[] getFailures() { @@ -329,7 +330,7 @@ public class MetricsMap<T extends IceMX.Metrics> } return failures.toArray(new IceMX.MetricsFailures[failures.size()]); } - + synchronized IceMX.MetricsFailures getFailures(String id) { @@ -357,7 +358,7 @@ public class MetricsMap<T extends IceMX.Metrics> return null; } - public Entry + public Entry getMatching(IceMX.MetricsHelper<T> helper, Entry previous) { // @@ -411,7 +412,7 @@ public class MetricsMap<T extends IceMX.Metrics> // // Lookup the metrics object. - // + // synchronized(this) { if(previous != null && previous._object.id.equals(key)) @@ -439,21 +440,21 @@ public class MetricsMap<T extends IceMX.Metrics> return e; } } - - private void + + private void detached(Entry entry) { if(_retain == 0) { return; } - + if(_detachedQueue == null) { _detachedQueue = new java.util.LinkedList<Entry>(); } assert(_detachedQueue.size() <= _retain); - + // Compress the queue by removing entries which are no longer detached. java.util.Iterator<Entry> p = _detachedQueue.iterator(); while(p.hasNext()) @@ -464,17 +465,17 @@ public class MetricsMap<T extends IceMX.Metrics> p.remove(); } } - + // If there's still no room, remove the oldest entry (at the front). if(_detachedQueue.size() == _retain) { _objects.remove(_detachedQueue.pollFirst()._object.id); } - + // Add the entry at the back of the queue. _detachedQueue.add(entry); } - + private java.util.Map<String, java.util.regex.Pattern> parseRule(Ice.Properties properties, String name) { diff --git a/java/src/IceInternal/MetricsViewI.java b/java/src/IceInternal/MetricsViewI.java index ecfada75c3d..2f535e234f3 100644 --- a/java/src/IceInternal/MetricsViewI.java +++ b/java/src/IceInternal/MetricsViewI.java @@ -17,7 +17,7 @@ public class MetricsViewI } public boolean - addOrUpdateMap(Ice.Properties properties, String mapName, MetricsAdminI.MetricsMapFactory<?> factory, + addOrUpdateMap(Ice.Properties properties, String mapName, MetricsAdminI.MetricsMapFactory<?> factory, Ice.Logger logger) { // @@ -26,7 +26,7 @@ public class MetricsViewI String viewPrefix = "IceMX.Metrics." + _name + "."; String mapsPrefix = viewPrefix + "Map."; java.util.Map<String, String> mapsProps = properties.getPropertiesForPrefix(mapsPrefix); - + String mapPrefix; java.util.Map<String, String> mapProps = new java.util.HashMap<String, String>(); if(!mapsProps.isEmpty()) @@ -50,13 +50,13 @@ public class MetricsViewI // This map is disabled for this view. return _maps.remove(mapName) != null; } - + MetricsMap<?> m = _maps.get(mapName); if(m != null && m.getProperties().equals(mapProps)) { return false; // The map configuration didn't change, no need to re-create. } - + try { _maps.put(mapName, factory.create(mapPrefix, properties)); @@ -68,7 +68,7 @@ public class MetricsViewI } return true; } - + public boolean removeMap(String mapName) { @@ -114,7 +114,7 @@ public class MetricsViewI return _maps.keySet(); } - @SuppressWarnings("unchecked") + @SuppressWarnings("unchecked") public <T extends IceMX.Metrics> MetricsMap<T> getMap(String mapName, Class<T> cl) { diff --git a/java/src/IceInternal/Network.java b/java/src/IceInternal/Network.java index 01f357a339d..c06e7bf9550 100644 --- a/java/src/IceInternal/Network.java +++ b/java/src/IceInternal/Network.java @@ -1364,6 +1364,7 @@ public final class Network _ipv6 = ipv6; } + @Override public int compare(java.net.InetSocketAddress lhs, java.net.InetSocketAddress rhs) { diff --git a/java/src/IceInternal/ObjectAdapterFactory.java b/java/src/IceInternal/ObjectAdapterFactory.java index e8d01a647b5..308be141f5b 100644 --- a/java/src/IceInternal/ObjectAdapterFactory.java +++ b/java/src/IceInternal/ObjectAdapterFactory.java @@ -30,7 +30,7 @@ public final class ObjectAdapterFactory _communicator = null; adapters = new java.util.LinkedList<Ice.ObjectAdapterI>(_adapters); - + notifyAll(); } @@ -66,7 +66,7 @@ public final class ObjectAdapterFactory adapters = new java.util.LinkedList<Ice.ObjectAdapterI>(_adapters); } - + // // Now we wait for deactivation of each object adapter. // @@ -106,7 +106,7 @@ public final class ObjectAdapterFactory _adapters.clear(); } } - + public void updateConnectionObservers() { @@ -232,6 +232,7 @@ public final class ObjectAdapterFactory _communicator = communicator; } + @Override protected synchronized void finalize() throws Throwable diff --git a/java/src/IceInternal/ObjectFactoryManager.java b/java/src/IceInternal/ObjectFactoryManager.java index 340f8359321..c8ffdef9ca9 100644 --- a/java/src/IceInternal/ObjectFactoryManager.java +++ b/java/src/IceInternal/ObjectFactoryManager.java @@ -43,7 +43,7 @@ public final class ObjectFactoryManager _factoryMap.remove(id); } - factory.destroy(); + factory.destroy(); } public synchronized Ice.ObjectFactory diff --git a/java/src/IceInternal/ObjectInputStream.java b/java/src/IceInternal/ObjectInputStream.java index d75d7804630..d8c619f5281 100644 --- a/java/src/IceInternal/ObjectInputStream.java +++ b/java/src/IceInternal/ObjectInputStream.java @@ -25,6 +25,7 @@ public class ObjectInputStream extends java.io.ObjectInputStream _instance = instance; } + @Override protected Class<?> resolveClass(java.io.ObjectStreamClass cls) throws java.io.IOException, ClassNotFoundException diff --git a/java/src/IceInternal/OpaqueEndpointI.java b/java/src/IceInternal/OpaqueEndpointI.java index 70e3559a82b..b4f291f7751 100644 --- a/java/src/IceInternal/OpaqueEndpointI.java +++ b/java/src/IceInternal/OpaqueEndpointI.java @@ -44,6 +44,7 @@ final class OpaqueEndpointI extends EndpointI // // Marshal the endpoint // + @Override public void streamWrite(BasicStream s) { s.startWriteEncaps(_rawEncoding, Ice.FormatType.DefaultFormat); @@ -54,20 +55,24 @@ final class OpaqueEndpointI extends EndpointI // // Return the endpoint information. // + @Override public Ice.EndpointInfo getInfo() { return new Ice.OpaqueEndpointInfo(-1, false, _rawEncoding, _rawBytes) { + @Override public short type() { return _type; } + @Override public boolean datagram() { return false; } + @Override public boolean secure() { return false; @@ -78,6 +83,7 @@ final class OpaqueEndpointI extends EndpointI // // Return the endpoint type // + @Override public short type() { return _type; @@ -86,6 +92,7 @@ final class OpaqueEndpointI extends EndpointI // // Return the protocol name // + @Override public String protocol() { return "opaque"; @@ -95,6 +102,7 @@ final class OpaqueEndpointI extends EndpointI // Return the timeout for the endpoint in milliseconds. 0 means // non-blocking, -1 means no timeout. // + @Override public int timeout() { return -1; @@ -105,11 +113,13 @@ final class OpaqueEndpointI extends EndpointI // that timeouts are supported by the endpoint. Otherwise the same // endpoint is returned. // + @Override public EndpointI timeout(int t) { return this; } + @Override public String connectionId() { return ""; @@ -118,6 +128,7 @@ final class OpaqueEndpointI extends EndpointI // // Return a new endpoint with a different connection id. // + @Override public EndpointI connectionId(String connectionId) { return this; @@ -127,6 +138,7 @@ final class OpaqueEndpointI extends EndpointI // Return true if the endpoints support bzip2 compress, or false // otherwise. // + @Override public boolean compress() { return false; @@ -137,6 +149,7 @@ final class OpaqueEndpointI extends EndpointI // provided that compression is supported by the // endpoint. Otherwise the same endpoint is returned. // + @Override public EndpointI compress(boolean compress) { return this; @@ -145,6 +158,7 @@ final class OpaqueEndpointI extends EndpointI // // Return true if the endpoint is datagram-based. // + @Override public boolean datagram() { return false; @@ -153,6 +167,7 @@ final class OpaqueEndpointI extends EndpointI // // Return true if the endpoint is secure. // + @Override public boolean secure() { return false; @@ -173,6 +188,7 @@ final class OpaqueEndpointI extends EndpointI // "effective" endpoint, which might differ from this endpoint, // for example, if a dynamic port number is assigned. // + @Override public Transceiver transceiver(EndpointIHolder endpoint) { endpoint.value = null; @@ -183,11 +199,13 @@ final class OpaqueEndpointI extends EndpointI // Return connectors for this endpoint, or empty list if no connector // is available. // + @Override public java.util.List<Connector> connectors(Ice.EndpointSelectionType selType) { return new java.util.ArrayList<Connector>(); } + @Override public void connectors_async(Ice.EndpointSelectionType selType, EndpointI_connectors callback) { callback.connectors(new java.util.ArrayList<Connector>()); @@ -200,6 +218,7 @@ final class OpaqueEndpointI extends EndpointI // from this endpoint, for example, if a dynamic port number is // assigned. // + @Override public Acceptor acceptor(EndpointIHolder endpoint, String adapterName) { endpoint.value = null; @@ -211,6 +230,7 @@ final class OpaqueEndpointI extends EndpointI // host if listening on INADDR_ANY on server side or if no host // was specified on client side. // + @Override public java.util.List<EndpointI> expand() { java.util.List<EndpointI> endps = new java.util.ArrayList<EndpointI>(); @@ -221,16 +241,19 @@ final class OpaqueEndpointI extends EndpointI // // Check whether the endpoint is equivalent to another one. // + @Override public boolean equivalent(EndpointI endpoint) { return false; } + @Override public int hashCode() { return _hashCode; } + @Override public String options() { String s = ""; @@ -249,6 +272,7 @@ final class OpaqueEndpointI extends EndpointI // // Compare endpoints for sorting purposes // + @Override public int compareTo(EndpointI obj) // From java.lang.Comparable { if(!(obj instanceof OpaqueEndpointI)) @@ -312,6 +336,7 @@ final class OpaqueEndpointI extends EndpointI return 0; } + @Override protected boolean checkOption(String option, String argument, String endpoint) { switch(option.charAt(1)) diff --git a/java/src/IceInternal/Outgoing.java b/java/src/IceInternal/Outgoing.java index 69d7b3d6cad..c4f79392e36 100644 --- a/java/src/IceInternal/Outgoing.java +++ b/java/src/IceInternal/Outgoing.java @@ -55,7 +55,7 @@ public final class Outgoing implements OutgoingMessageCallback writeHeader(op, mode, context, explicitCtx); } - public void + public void detach() { if(_observer != null) @@ -146,14 +146,14 @@ public final class Outgoing implements OutgoingMessageCallback } } } - + if(timedOut) { _handler.requestTimedOut(this); // // Wait for the exception to propagate. It's possible the request handler ignores - // the timeout if there was a failure shortly before requestTimedOut got called. + // the timeout if there was a failure shortly before requestTimedOut got called. // In this case, the exception should be set on the Outgoing. // synchronized(this) @@ -237,6 +237,7 @@ public final class Outgoing implements OutgoingMessageCallback throw ex; } + @Override public boolean send(Ice.ConnectionI connection, boolean compress, boolean response) throws RetryException @@ -244,12 +245,14 @@ public final class Outgoing implements OutgoingMessageCallback return connection.sendRequest(this, compress, response); } + @Override public void invokeCollocated(CollocatedRequestHandler handler) { handler.invokeRequest(this); } + @Override synchronized public void sent() { @@ -265,14 +268,14 @@ public final class Outgoing implements OutgoingMessageCallback _sent = true; notify(); } - + public synchronized void finished(BasicStream is) { assert(_proxy.__reference().getMode() == Reference.ModeTwoway); // Only for twoways. - + assert(_state <= StateInProgress); - + if(_childObserver != null) { _childObserver.reply(is.size() - Protocol.headerSize - 4); @@ -286,7 +289,7 @@ public final class Outgoing implements OutgoingMessageCallback } _is.swap(is); byte replyStatus = _is.readByte(); - + switch(replyStatus) { case ReplyStatus.replyOK: @@ -294,7 +297,7 @@ public final class Outgoing implements OutgoingMessageCallback _state = StateOK; // The state must be set last, in case there is an exception. break; } - + case ReplyStatus.replyUserException: { if(_observer != null) @@ -304,7 +307,7 @@ public final class Outgoing implements OutgoingMessageCallback _state = StateUserException; // The state must be set last, in case there is an exception. break; } - + case ReplyStatus.replyObjectNotExist: case ReplyStatus.replyFacetNotExist: case ReplyStatus.replyOperationNotExist: @@ -317,26 +320,26 @@ public final class Outgoing implements OutgoingMessageCallback ex = new Ice.ObjectNotExistException(); break; } - + case ReplyStatus.replyFacetNotExist: { ex = new Ice.FacetNotExistException(); break; } - + case ReplyStatus.replyOperationNotExist: { ex = new Ice.OperationNotExistException(); break; } - + default: { assert(false); break; } } - + ex.id = new Ice.Identity(); ex.id.__read(_is); @@ -363,7 +366,7 @@ public final class Outgoing implements OutgoingMessageCallback _state = StateLocalException; // The state must be set last, in case there is an exception. break; } - + case ReplyStatus.replyUnknownException: case ReplyStatus.replyUnknownLocalException: case ReplyStatus.replyUnknownUserException: @@ -376,33 +379,33 @@ public final class Outgoing implements OutgoingMessageCallback ex = new Ice.UnknownException(); break; } - + case ReplyStatus.replyUnknownLocalException: { ex = new Ice.UnknownLocalException(); break; } - - case ReplyStatus.replyUnknownUserException: + + case ReplyStatus.replyUnknownUserException: { ex = new Ice.UnknownUserException(); break; } - + default: { assert(false); break; } } - + ex.unknown = _is.readString(); _exception = ex; _state = StateLocalException; // The state must be set last, in case there is an exception. break; } - + default: { _exception = new Ice.UnknownReplyStatusException(); @@ -414,6 +417,7 @@ public final class Outgoing implements OutgoingMessageCallback notify(); } + @Override public synchronized void finished(Ice.Exception ex) { @@ -443,21 +447,21 @@ public final class Outgoing implements OutgoingMessageCallback _exception = ex; notify(); } - + public BasicStream os() { return _os; } - public BasicStream + public BasicStream startReadParams() { _is.startReadEncaps(); return _is; } - public void + public void endReadParams() { _is.endReadEncaps(); @@ -494,7 +498,7 @@ public final class Outgoing implements OutgoingMessageCallback _os.writeEmptyEncaps(_encoding); } - public void + public void writeParamEncaps(byte[] encaps) { if(encaps == null || encaps.length == 0) @@ -507,13 +511,13 @@ public final class Outgoing implements OutgoingMessageCallback } } - public boolean + public boolean hasResponse() { return _is != null && !_is.isEmpty(); } - public void + public void throwUserException() throws Ice.UserException { @@ -529,7 +533,7 @@ public final class Outgoing implements OutgoingMessageCallback } } - public void + public void attachRemoteObserver(Ice.ConnectionInfo info, Ice.Endpoint endpt, int requestId, int size) { if(_observer != null) @@ -638,7 +642,7 @@ public final class Outgoing implements OutgoingMessageCallback // Ice.ImplicitContextI implicitContext = _proxy.__reference().getInstance().getImplicitContext(); java.util.Map<String, String> prxContext = _proxy.__reference().getContext(); - + if(implicitContext == null) { Ice.ContextHelper.write(_os, prxContext); @@ -663,7 +667,7 @@ public final class Outgoing implements OutgoingMessageCallback private BasicStream _os; private boolean _sent; private Ice.Exception _exception; - + private static final int StateUnsent = 0; private static final int StateInProgress = 1; private static final int StateOK = 2; diff --git a/java/src/IceInternal/OutgoingAsync.java b/java/src/IceInternal/OutgoingAsync.java index d939318fd9e..9095fdb94c5 100644 --- a/java/src/IceInternal/OutgoingAsync.java +++ b/java/src/IceInternal/OutgoingAsync.java @@ -94,12 +94,13 @@ public class OutgoingAsync extends Ice.AsyncResult implements OutgoingAsyncMessa } } - @Override public Ice.ObjectPrx + @Override public Ice.ObjectPrx getProxy() { return _proxy; } + @Override public int __send(Ice.ConnectionI connection, boolean compress, boolean response) throws RetryException @@ -108,13 +109,15 @@ public class OutgoingAsync extends Ice.AsyncResult implements OutgoingAsyncMessa return connection.sendAsyncRequest(this, compress, response); } + @Override public int __invokeCollocated(CollocatedRequestHandler handler) { return handler.invokeAsyncRequest(this); } - public boolean + @Override + public boolean __sent() { synchronized(_monitor) @@ -122,7 +125,7 @@ public class OutgoingAsync extends Ice.AsyncResult implements OutgoingAsyncMessa boolean alreadySent = (_state & Sent) != 0; _state |= Sent; _sent = true; - + assert((_state & Done) == 0); if(!_proxy.ice_isTwoway()) @@ -146,13 +149,15 @@ public class OutgoingAsync extends Ice.AsyncResult implements OutgoingAsyncMessa } } - public void + @Override + public void __invokeSent() { __invokeSentInternal(); } - public void + @Override + public void __finished(Ice.Exception exc) { synchronized(_monitor) @@ -182,7 +187,7 @@ public class OutgoingAsync extends Ice.AsyncResult implements OutgoingAsyncMessa { return; // Can't be retried immediately. } - + __invoke(false); // Retry the invocation } catch(Ice.Exception ex) @@ -191,12 +196,14 @@ public class OutgoingAsync extends Ice.AsyncResult implements OutgoingAsyncMessa } } - public void + @Override + public void __dispatchInvocationTimeout(ThreadPool threadPool, Ice.Connection connection) { threadPool.dispatch( new DispatchWorkItem(connection) { + @Override public void run() { @@ -377,7 +384,7 @@ public class OutgoingAsync extends Ice.AsyncResult implements OutgoingAsyncMessa __invokeCompleted(); } - public final boolean + public final boolean __invoke(boolean synchronous) { while(true) @@ -458,7 +465,7 @@ public class OutgoingAsync extends Ice.AsyncResult implements OutgoingAsyncMessa _os.writeEmptyEncaps(_encoding); } - public void + public void __writeParamEncaps(byte[] encaps) { if(encaps == null || encaps.length == 0) @@ -477,13 +484,14 @@ public class OutgoingAsync extends Ice.AsyncResult implements OutgoingAsyncMessa return _is; } - public void + @Override + public void run() { __runTimerTask(); } - private boolean + private boolean handleException(Ice.Exception exc) { try diff --git a/java/src/IceInternal/OutgoingAsyncMessageCallback.java b/java/src/IceInternal/OutgoingAsyncMessageCallback.java index 4b6b73a8b06..269ba2a0123 100644 --- a/java/src/IceInternal/OutgoingAsyncMessageCallback.java +++ b/java/src/IceInternal/OutgoingAsyncMessageCallback.java @@ -27,7 +27,7 @@ public interface OutgoingAsyncMessageCallback // Called by the connection when the message is confirmed sent. The connection is locked // when this is called so this method can call the sent callback. Instead, this method // returns true if there's a sent callback and false otherwise. If true is returned, the - // connection will call the __invokeSent() method bellow (which in turn should call the + // connection will call the __invokeSent() method bellow (which in turn should call the // sent callback). // boolean __sent(); @@ -36,7 +36,7 @@ public interface OutgoingAsyncMessageCallback // Called by the connection to call the user sent callback. // void __invokeSent(); - + // // Called by the connection when the request failed. // diff --git a/java/src/IceInternal/OutgoingConnectionFactory.java b/java/src/IceInternal/OutgoingConnectionFactory.java index f9e5a50b57a..63ebc0bd919 100644 --- a/java/src/IceInternal/OutgoingConnectionFactory.java +++ b/java/src/IceInternal/OutgoingConnectionFactory.java @@ -455,6 +455,7 @@ public final class OutgoingConnectionFactory _destroyed = false; } + @Override protected synchronized void finalize() throws Throwable @@ -975,6 +976,7 @@ public final class OutgoingConnectionFactory endpoint = e; } + @Override public boolean equals(Object obj) { @@ -982,6 +984,7 @@ public final class OutgoingConnectionFactory return connector.equals(r.connector); } + @Override public int hashCode() { @@ -1008,6 +1011,7 @@ public final class OutgoingConnectionFactory // // Methods from ConnectionI.StartCallback // + @Override public void connectionStartCompleted(Ice.ConnectionI connection) { @@ -1019,6 +1023,7 @@ public final class OutgoingConnectionFactory _factory.finishGetConnection(_connectors, _current, connection, this); } + @Override public void connectionStartFailed(Ice.ConnectionI connection, Ice.LocalException ex) { @@ -1048,6 +1053,7 @@ public final class OutgoingConnectionFactory // // Methods from EndpointI_connectors // + @Override public void connectors(java.util.List<Connector> cons) { @@ -1073,6 +1079,7 @@ public final class OutgoingConnectionFactory } } + @Override public void exception(Ice.LocalException ex) { @@ -1214,18 +1221,18 @@ public final class OutgoingConnectionFactory { assert(_iter.hasNext()); _current = _iter.next(); - + Ice.Instrumentation.CommunicatorObserver obsv = _factory._instance.getObserver(); if(obsv != null) { - _observer = obsv.getConnectionEstablishmentObserver(_current.endpoint, + _observer = obsv.getConnectionEstablishmentObserver(_current.endpoint, _current.connector.toString()); if(_observer != null) { _observer.attach(); } } - + connection = _factory.createConnection(_current.connector.connect(), _current); connection.start(this); } @@ -1250,7 +1257,7 @@ public final class OutgoingConnectionFactory private Ice.Communicator _communicator; private final Instance _instance; - private final FactoryACMMonitor _monitor; + private final FactoryACMMonitor _monitor; private boolean _destroyed; private MultiHashMap<Connector, Ice.ConnectionI> _connections = new MultiHashMap<Connector, Ice.ConnectionI>(); diff --git a/java/src/IceInternal/OutputStreamWrapper.java b/java/src/IceInternal/OutputStreamWrapper.java index fb75fa65a70..722f420603a 100644 --- a/java/src/IceInternal/OutputStreamWrapper.java +++ b/java/src/IceInternal/OutputStreamWrapper.java @@ -38,6 +38,7 @@ public class OutputStreamWrapper extends java.io.OutputStream _pos = 0; } + @Override public void write(int b) throws IOException { @@ -81,12 +82,14 @@ public class OutputStreamWrapper extends java.io.OutputStream } } + @Override public void write(byte[] b) throws IOException { write(b, 0, b.length); } + @Override public void write(byte[] bytes, int offset, int count) throws IOException { @@ -131,6 +134,7 @@ public class OutputStreamWrapper extends java.io.OutputStream } } + @Override public void flush() throws IOException { @@ -138,6 +142,7 @@ public class OutputStreamWrapper extends java.io.OutputStream // and we cannot write to the BasicStream until we know whether the final size is < 255 or not. } + @Override public void close() throws IOException { diff --git a/java/src/IceInternal/ProcessI.java b/java/src/IceInternal/ProcessI.java index 6b43535dd25..63112845c83 100644 --- a/java/src/IceInternal/ProcessI.java +++ b/java/src/IceInternal/ProcessI.java @@ -15,13 +15,15 @@ public class ProcessI extends Ice._ProcessDisp { _communicator = communicator; } - + + @Override public void shutdown(Ice.Current current) { _communicator.shutdown(); } - + + @Override public void writeMessage(String message, int fd, Ice.Current current) { @@ -39,6 +41,6 @@ public class ProcessI extends Ice._ProcessDisp } } } - + private Ice.Communicator _communicator; } diff --git a/java/src/IceInternal/PropertiesAdminI.java b/java/src/IceInternal/PropertiesAdminI.java index 9e639105d80..726d8fa3847 100644 --- a/java/src/IceInternal/PropertiesAdminI.java +++ b/java/src/IceInternal/PropertiesAdminI.java @@ -18,25 +18,28 @@ public class PropertiesAdminI extends Ice._PropertiesAdminDisp implements Ice.Na _logger = logger; } + @Override public synchronized String getProperty(String name, Ice.Current current) { return _properties.getProperty(name); } + @Override public synchronized java.util.TreeMap<String, String> getPropertiesForPrefix(String name, Ice.Current current) { return new java.util.TreeMap<String, String>(_properties.getPropertiesForPrefix(name)); } + @Override synchronized public void setProperties_async(Ice.AMD_PropertiesAdmin_setProperties cb, java.util.Map<String, String> props, Ice.Current current) { java.util.Map<String, String> old = _properties.getPropertiesForPrefix(""); final int traceLevel = _properties.getPropertyAsInt("Ice.Trace.Admin.Properties"); - + // // Compute the difference between the new property set and the existing property set: // @@ -168,7 +171,7 @@ public class PropertiesAdminI extends Ice._PropertiesAdminDisp implements Ice.Na // // Copy the callbacks to allow callbacks to update the callbacks. // - java.util.List<Ice.PropertiesAdminUpdateCallback> callbacks = + java.util.List<Ice.PropertiesAdminUpdateCallback> callbacks = new java.util.ArrayList<Ice.PropertiesAdminUpdateCallback>(_updateCallbacks); java.util.Map<String, String> changes = new java.util.HashMap<String, String>(added); @@ -188,12 +191,14 @@ public class PropertiesAdminI extends Ice._PropertiesAdminDisp implements Ice.Na } } + @Override public synchronized void addUpdateCallback (Ice.PropertiesAdminUpdateCallback cb) { _updateCallbacks.add(cb); } + @Override public synchronized void removeUpdateCallback(Ice.PropertiesAdminUpdateCallback cb) { @@ -203,6 +208,6 @@ public class PropertiesAdminI extends Ice._PropertiesAdminDisp implements Ice.Na private final String _name; private final Ice.Properties _properties; private final Ice.Logger _logger; - private java.util.List<Ice.PropertiesAdminUpdateCallback> _updateCallbacks = + private java.util.List<Ice.PropertiesAdminUpdateCallback> _updateCallbacks = new java.util.ArrayList<Ice.PropertiesAdminUpdateCallback>(); } diff --git a/java/src/IceInternal/Protocol.java b/java/src/IceInternal/Protocol.java index 8d1769f2de4..a129e406a22 100644 --- a/java/src/IceInternal/Protocol.java +++ b/java/src/IceInternal/Protocol.java @@ -98,7 +98,7 @@ final public class Protocol }; static final public Ice.ProtocolVersion currentProtocol = new Ice.ProtocolVersion(protocolMajor, protocolMinor); - static final public Ice.EncodingVersion currentProtocolEncoding = new Ice.EncodingVersion(protocolEncodingMajor, + static final public Ice.EncodingVersion currentProtocolEncoding = new Ice.EncodingVersion(protocolEncodingMajor, protocolEncodingMinor); static final public Ice.EncodingVersion currentEncoding = new Ice.EncodingVersion(encodingMajor, encodingMinor); @@ -151,7 +151,7 @@ final public class Protocol // Unsupported but compatible, use the currently supported // protocol, that's the best we can do. // - return currentProtocol; + return currentProtocol; } } @@ -176,7 +176,7 @@ final public class Protocol // Unsupported but compatible, use the currently supported // encoding, that's the best we can do. // - return currentEncoding; + return currentEncoding; } } diff --git a/java/src/IceInternal/ProtocolPluginFacadeI.java b/java/src/IceInternal/ProtocolPluginFacadeI.java index d4213bba8b8..2a49474b159 100644 --- a/java/src/IceInternal/ProtocolPluginFacadeI.java +++ b/java/src/IceInternal/ProtocolPluginFacadeI.java @@ -21,6 +21,7 @@ public class ProtocolPluginFacadeI implements ProtocolPluginFacade // Get the Communicator instance with which this facade is // associated. // + @Override public Ice.Communicator getCommunicator() { return _communicator; @@ -29,6 +30,7 @@ public class ProtocolPluginFacadeI implements ProtocolPluginFacade // // Register an EndpointFactory. // + @Override public void addEndpointFactory(EndpointFactory factory) { _instance.endpointFactoryManager().add(factory); @@ -37,6 +39,7 @@ public class ProtocolPluginFacadeI implements ProtocolPluginFacade // // Register an EndpointFactory. // + @Override public EndpointFactory getEndpointFactory(short type) { return _instance.endpointFactoryManager().get(type); @@ -45,6 +48,7 @@ public class ProtocolPluginFacadeI implements ProtocolPluginFacade // // Look up a Java class by name. // + @Override public Class<?> findClass(String className) { return _instance.findClass(className); diff --git a/java/src/IceInternal/ProxyFactory.java b/java/src/IceInternal/ProxyFactory.java index 6283de1dc0e..c0b2d60e150 100644 --- a/java/src/IceInternal/ProxyFactory.java +++ b/java/src/IceInternal/ProxyFactory.java @@ -103,7 +103,7 @@ public final class ProxyFactory { TraceLevels traceLevels = _instance.traceLevels(); Ice.Logger logger = _instance.initializationData().logger; - + // // We don't retry batch requests because the exception might have caused // the all the requests batched with the connection to be aborted and we @@ -280,7 +280,7 @@ public final class ProxyFactory // // If -1 is the first value, no retry and wait intervals. - // + // if(i == 0 && v == -1) { _retryIntervals = new int[0]; diff --git a/java/src/IceInternal/Reference.java b/java/src/IceInternal/Reference.java index 1fed84467d0..f0f49a75260 100644 --- a/java/src/IceInternal/Reference.java +++ b/java/src/IceInternal/Reference.java @@ -37,13 +37,13 @@ public abstract class Reference implements Cloneable } public final Ice.ProtocolVersion - getProtocol() + getProtocol() { return _protocol; } public final Ice.EncodingVersion - getEncoding() + getEncoding() { return _encoding; } @@ -78,7 +78,7 @@ public abstract class Reference implements Cloneable return _invocationTimeout; } - public final Ice.Communicator + public final Ice.Communicator getCommunicator() { return _communicator; @@ -138,7 +138,7 @@ public abstract class Reference implements Cloneable { return this; } - Reference r = (Reference)_instance.referenceFactory().copy(this); + Reference r = _instance.referenceFactory().copy(this); r._secure = newSecure; return r; } @@ -201,7 +201,7 @@ public abstract class Reference implements Cloneable Reference r = _instance.referenceFactory().copy(this); r._compress = newCompress; r._overrideCompress = true; - return r; + return r; } public abstract Reference changeAdapterId(String newAdapterId); @@ -217,6 +217,7 @@ public abstract class Reference implements Cloneable public abstract Reference changeTimeout(int newTimeout); public abstract Reference changeConnectionId(String connectionId); + @Override public synchronized int hashCode() { @@ -224,7 +225,7 @@ public abstract class Reference implements Cloneable { return _hashValue; } - + int h = 5381; h = IceInternal.HashUtil.hashAdd(h, _mode); h = IceInternal.HashUtil.hashAdd(h, _secure); @@ -292,6 +293,7 @@ public abstract class Reference implements Cloneable // // Convert the reference to its string form. // + @Override public String toString() { @@ -396,7 +398,7 @@ public abstract class Reference implements Cloneable // Always print the encoding version to ensure a stringified proxy // will convert back to a proxy with the same encoding with // stringToProxy (and won't use Ice.Default.EncodingVersion). - // + // s.append(" -e "); s.append(Ice.Util.encodingVersionToString(_encoding)); @@ -413,6 +415,7 @@ public abstract class Reference implements Cloneable public abstract Ice.ConnectionI getConnection(Ice.BooleanHolder comp); public abstract void getConnection(GetConnectionCallback callback); + @Override public boolean equals(java.lang.Object obj) { @@ -474,6 +477,7 @@ public abstract class Reference implements Cloneable return true; } + @Override public Object clone() { // diff --git a/java/src/IceInternal/ReferenceFactory.java b/java/src/IceInternal/ReferenceFactory.java index b5e7aca509e..c6914703f80 100644 --- a/java/src/IceInternal/ReferenceFactory.java +++ b/java/src/IceInternal/ReferenceFactory.java @@ -19,7 +19,7 @@ public final class ReferenceFactory return null; } - return create(ident, facet, tmpl.getMode(), tmpl.getSecure(), tmpl.getProtocol(), tmpl.getEncoding(), + return create(ident, facet, tmpl.getMode(), tmpl.getSecure(), tmpl.getProtocol(), tmpl.getEncoding(), endpoints, null, null); } @@ -31,7 +31,7 @@ public final class ReferenceFactory return null; } - return create(ident, facet, tmpl.getMode(), tmpl.getSecure(), tmpl.getProtocol(), tmpl.getEncoding(), null, + return create(ident, facet, tmpl.getMode(), tmpl.getSecure(), tmpl.getProtocol(), tmpl.getEncoding(), null, adapterId, null); } @@ -47,9 +47,9 @@ public final class ReferenceFactory // Create new reference // return new FixedReference( - _instance, - _communicator, - ident, + _instance, + _communicator, + ident, "", // Facet fixedConnection.endpoint().datagram() ? Reference.ModeDatagram : Reference.ModeTwoway, fixedConnection.endpoint().secure(), @@ -343,14 +343,14 @@ public final class ReferenceFactory { throw new Ice.ProxyParseException("no argument provided for -e option in `" + s + "'"); } - + try { encoding = Ice.Util.stringToEncodingVersion(argument); } catch(Ice.VersionParseException e) { - throw new Ice.ProxyParseException("invalid encoding version `" + argument + "' in `" + s + + throw new Ice.ProxyParseException("invalid encoding version `" + argument + "' in `" + s + "':\n" + e.str); } break; @@ -362,14 +362,14 @@ public final class ReferenceFactory { throw new Ice.ProxyParseException("no argument provided for -p option in `" + s + "'"); } - + try { protocol = Ice.Util.stringToProtocolVersion(argument); } catch(Ice.VersionParseException e) { - throw new Ice.ProxyParseException("invalid protocol version `" + argument + "' in `" + s + + throw new Ice.ProxyParseException("invalid protocol version `" + argument + "' in `" + s + "':\n" + e.str); } break; @@ -399,7 +399,7 @@ public final class ReferenceFactory while(end < s.length() && s.charAt(end) == ':') { beg = end + 1; - + end = beg; while(true) { @@ -442,7 +442,7 @@ public final class ReferenceFactory ++end; } } - + String es = s.substring(beg, end); EndpointI endp = _instance.endpointFactoryManager().create(es, false); if(endp != null) @@ -574,7 +574,7 @@ public final class ReferenceFactory facet = ""; } - int mode = (int)s.readByte(); + int mode = s.readByte(); if(mode < 0 || mode > Reference.ModeLast) { throw new Ice.ProxyUnmarshalException(); @@ -624,7 +624,7 @@ public final class ReferenceFactory { return this; } - + ReferenceFactory factory = new ReferenceFactory(_instance, _communicator); factory._defaultLocator = _defaultLocator; factory._defaultRouter = defaultRouter; @@ -644,7 +644,7 @@ public final class ReferenceFactory { return this; } - + ReferenceFactory factory = new ReferenceFactory(_instance, _communicator); factory._defaultRouter = _defaultRouter; factory._defaultLocator = defaultLocator; @@ -684,7 +684,7 @@ public final class ReferenceFactory { // // Do not warn about unknown properties if Ice prefix, ie Ice, Glacier2, etc - // + // for(int i = 0; IceInternal.PropertyNames.clPropNames[i] != null; ++i) { if(prefix.startsWith(IceInternal.PropertyNames.clPropNames[i] + ".")) @@ -732,7 +732,7 @@ public final class ReferenceFactory } private Reference - create(Ice.Identity ident, String facet, int mode, boolean secure, Ice.ProtocolVersion protocol, + create(Ice.Identity ident, String facet, int mode, boolean secure, Ice.ProtocolVersion protocol, Ice.EncodingVersion encoding, EndpointI[] endpoints, String adapterId, String propertyPrefix) { DefaultsAndOverrides defaultsAndOverrides = _instance.defaultsAndOverrides(); @@ -776,9 +776,9 @@ public final class ReferenceFactory { checkForUnknownProperties(propertyPrefix); } - + String property; - + property = propertyPrefix + ".Locator"; Ice.LocatorPrx locator = Ice.LocatorPrxHelper.uncheckedCast(_communicator.propertyToProxy(property)); if(locator != null) @@ -808,7 +808,7 @@ public final class ReferenceFactory routerInfo = _instance.routerManager().get(router); } } - + property = propertyPrefix + ".CollocationOptimized"; collocationOptimized = properties.getPropertyAsIntWithDefault(property, collocationOptimized ? 1 : 0) > 0; @@ -825,7 +825,7 @@ public final class ReferenceFactory if(type.equals("Random")) { endpointSelection = Ice.EndpointSelectionType.Random; - } + } else if(type.equals("Ordered")) { endpointSelection = Ice.EndpointSelectionType.Ordered; @@ -836,7 +836,7 @@ public final class ReferenceFactory "'; expected `Random' or `Ordered'"); } } - + property = propertyPrefix + ".LocatorCacheTimeout"; locatorCacheTimeout = properties.getPropertyAsIntWithDefault(property, locatorCacheTimeout); @@ -850,15 +850,15 @@ public final class ReferenceFactory context = new java.util.HashMap<String, String>(); for(java.util.Map.Entry<String, String> e : contexts.entrySet()) { - context.put(e.getKey().substring(property.length()), e.getValue()); + context.put(e.getKey().substring(property.length()), e.getValue()); } } } - + // // Create new reference // - return new RoutableReference(_instance, + return new RoutableReference(_instance, _communicator, ident, facet, diff --git a/java/src/IceInternal/RemoteObserverI.java b/java/src/IceInternal/RemoteObserverI.java index e9d115ee0d9..c3c3c13e75e 100644 --- a/java/src/IceInternal/RemoteObserverI.java +++ b/java/src/IceInternal/RemoteObserverI.java @@ -9,15 +9,17 @@ package IceInternal; -public class RemoteObserverI - extends IceMX.ObserverWithDelegate<IceMX.RemoteMetrics, Ice.Instrumentation.RemoteObserver> +public class RemoteObserverI + extends IceMX.ObserverWithDelegate<IceMX.RemoteMetrics, Ice.Instrumentation.RemoteObserver> implements Ice.Instrumentation.RemoteObserver { + @Override public void reply(final int size) { forEach(new MetricsUpdate<IceMX.RemoteMetrics>() { + @Override public void update(IceMX.RemoteMetrics v) { diff --git a/java/src/IceInternal/RequestHandler.java b/java/src/IceInternal/RequestHandler.java index 92a94b0057a..e09c6019932 100644 --- a/java/src/IceInternal/RequestHandler.java +++ b/java/src/IceInternal/RequestHandler.java @@ -9,8 +9,6 @@ package IceInternal; -import Ice.Instrumentation.InvocationObserver; - public interface RequestHandler { void prepareBatchRequest(BasicStream out) diff --git a/java/src/IceInternal/RetryTask.java b/java/src/IceInternal/RetryTask.java index 6767526e9c1..850aea259be 100644 --- a/java/src/IceInternal/RetryTask.java +++ b/java/src/IceInternal/RetryTask.java @@ -17,6 +17,7 @@ class RetryTask implements Runnable _outAsync = outAsync; } + @Override public void run() { diff --git a/java/src/IceInternal/RoutableReference.java b/java/src/IceInternal/RoutableReference.java index de9d002f8b4..705aebc6475 100644 --- a/java/src/IceInternal/RoutableReference.java +++ b/java/src/IceInternal/RoutableReference.java @@ -11,66 +11,77 @@ package IceInternal; public class RoutableReference extends Reference { + @Override public final EndpointI[] getEndpoints() { return _endpoints; } + @Override public final String getAdapterId() { return _adapterId; } + @Override public final LocatorInfo getLocatorInfo() { return _locatorInfo; } + @Override public final RouterInfo getRouterInfo() { return _routerInfo; } + @Override public final boolean getCollocationOptimized() { return _collocationOptimized; } + @Override public final boolean getCacheConnection() { return _cacheConnection; } + @Override public final boolean getPreferSecure() { return _preferSecure; } + @Override public final Ice.EndpointSelectionType getEndpointSelection() { return _endpointSelection; } + @Override public final int getLocatorCacheTimeout() { return _locatorCacheTimeout; } + @Override public final String getConnectionId() { return _connectionId; } + @Override public Reference changeEncoding(Ice.EncodingVersion newEncoding) { @@ -87,6 +98,7 @@ public class RoutableReference extends Reference return r; } + @Override public Reference changeCompress(boolean newCompress) { @@ -103,6 +115,7 @@ public class RoutableReference extends Reference return r; } + @Override public Reference changeEndpoints(EndpointI[] newEndpoints) { @@ -117,6 +130,7 @@ public class RoutableReference extends Reference return r; } + @Override public Reference changeAdapterId(String newAdapterId) { @@ -127,9 +141,10 @@ public class RoutableReference extends Reference RoutableReference r = (RoutableReference)getInstance().referenceFactory().copy(this); r._adapterId = newAdapterId; r._endpoints = _emptyEndpoints; - return r; + return r; } + @Override public Reference changeLocator(Ice.LocatorPrx newLocator) { @@ -143,6 +158,7 @@ public class RoutableReference extends Reference return r; } + @Override public Reference changeRouter(Ice.RouterPrx newRouter) { @@ -156,6 +172,7 @@ public class RoutableReference extends Reference return r; } + @Override public Reference changeCollocationOptimized(boolean newCollocationOptimized) { @@ -168,6 +185,7 @@ public class RoutableReference extends Reference return r; } + @Override public final Reference changeCacheConnection(boolean newCache) { @@ -180,6 +198,7 @@ public class RoutableReference extends Reference return r; } + @Override public Reference changePreferSecure(boolean newPreferSecure) { @@ -192,6 +211,7 @@ public class RoutableReference extends Reference return r; } + @Override public final Reference changeEndpointSelection(Ice.EndpointSelectionType newType) { @@ -204,6 +224,7 @@ public class RoutableReference extends Reference return r; } + @Override public Reference changeLocatorCacheTimeout(int newTimeout) { @@ -213,9 +234,10 @@ public class RoutableReference extends Reference } RoutableReference r = (RoutableReference)getInstance().referenceFactory().copy(this); r._locatorCacheTimeout = newTimeout; - return r; + return r; } + @Override public Reference changeTimeout(int newTimeout) { @@ -235,9 +257,10 @@ public class RoutableReference extends Reference } r._endpoints = newEndpoints; } - return r; + return r; } + @Override public Reference changeConnectionId(String id) { @@ -256,21 +279,24 @@ public class RoutableReference extends Reference } r._endpoints = newEndpoints; } - return r; + return r; } + @Override public boolean isIndirect() { return _endpoints.length == 0; } + @Override public boolean isWellKnown() { return _endpoints.length == 0 && _adapterId.length() == 0; } + @Override public void streamWrite(BasicStream s) throws Ice.MarshalException @@ -293,6 +319,7 @@ public class RoutableReference extends Reference } } + @Override public String toString() { @@ -320,7 +347,7 @@ public class RoutableReference extends Reference else if(_adapterId.length() > 0) { s.append(" @ "); - + // // If the encoded adapter id string contains characters which // the reference parser uses as separators, then we enclose @@ -341,6 +368,7 @@ public class RoutableReference extends Reference return s.toString(); } + @Override public java.util.Map<String, String> toProperty(String prefix) { java.util.Map<String, String> properties = new java.util.HashMap<String, String>(); @@ -349,7 +377,7 @@ public class RoutableReference extends Reference properties.put(prefix + ".CollocationOptimized", _collocationOptimized ? "1" : "0"); properties.put(prefix + ".ConnectionCached", _cacheConnection ? "1" : "0"); properties.put(prefix + ".PreferSecure", _preferSecure ? "1" : "0"); - properties.put(prefix + ".EndpointSelection", + properties.put(prefix + ".EndpointSelection", _endpointSelection == Ice.EndpointSelectionType.Random ? "Random" : "Ordered"); { @@ -386,6 +414,7 @@ public class RoutableReference extends Reference return properties; } + @Override public synchronized int hashCode() { @@ -397,6 +426,7 @@ public class RoutableReference extends Reference return _hashValue; } + @Override public boolean equals(java.lang.Object obj) { @@ -465,6 +495,7 @@ public class RoutableReference extends Reference return true; } + @Override public Ice.ConnectionI getConnection(Ice.BooleanHolder comp) { @@ -514,7 +545,7 @@ public class RoutableReference extends Reference { assert(_locatorInfo != null); _locatorInfo.clearCache(this); - if(cached.value) + if(cached.value) { TraceLevels traceLevels = getInstance().traceLevels(); if(traceLevels.retry >= 2) @@ -530,6 +561,7 @@ public class RoutableReference extends Reference } } + @Override public void getConnection(final GetConnectionCallback callback) { @@ -541,6 +573,7 @@ public class RoutableReference extends Reference // _routerInfo.getClientEndpoints(new RouterInfo.GetClientEndpointsCallback() { + @Override public void setEndpoints(EndpointI[] endpts) { @@ -555,6 +588,7 @@ public class RoutableReference extends Reference } } + @Override public void setException(Ice.LocalException ex) { @@ -582,6 +616,7 @@ public class RoutableReference extends Reference { _locatorInfo.getEndpoints(this, _locatorCacheTimeout, new LocatorInfo.GetEndpointsCallback() { + @Override public void setEndpoints(EndpointI[] endpoints, final boolean cached) { @@ -590,16 +625,18 @@ public class RoutableReference extends Reference callback.setException(new Ice.NoEndpointException(self.toString())); return; } - + applyOverrides(endpoints); createConnection(endpoints, new GetConnectionCallback() { + @Override public void setConnection(Ice.ConnectionI connection, boolean compress) { callback.setConnection(connection, compress); } - + + @Override public void setException(Ice.LocalException exc) { @@ -632,7 +669,8 @@ public class RoutableReference extends Reference } }); } - + + @Override public void setException(Ice.LocalException ex) { @@ -702,7 +740,7 @@ public class RoutableReference extends Reference endpts[i] = endpts[i].connectionId(_connectionId); if(_overrideCompress) { - endpts[i] = endpts[i].compress(_compress); + endpts[i] = endpts[i].compress(_compress); } if(_overrideTimeout) { @@ -726,7 +764,7 @@ public class RoutableReference extends Reference endpoints.add(endpoint); } } - + // // Filter out endpoints according to the mode of the reference. // @@ -820,7 +858,7 @@ public class RoutableReference extends Reference java.util.Collections.sort(endpoints, _preferNonSecureEndpointComparator); } - return (EndpointI[])endpoints.toArray(new EndpointI[endpoints.size()]); + return endpoints.toArray(new EndpointI[endpoints.size()]); } protected Ice.ConnectionI @@ -831,7 +869,7 @@ public class RoutableReference extends Reference { throw new Ice.NoEndpointException(toString()); } - + // // Finally, create the connection. // @@ -854,9 +892,9 @@ public class RoutableReference extends Reference // create a new connection even if there's an existing // connection for one of the endpoints. // - + Ice.LocalException exception = null; - EndpointI[] endpoint = new EndpointI[1]; + EndpointI[] endpoint = new EndpointI[1]; for(int i = 0; i < endpoints.length; ++i) { try @@ -881,7 +919,7 @@ public class RoutableReference extends Reference assert(connection != null); - // + // // If we have a router, set the object adapter for this router // (if any) to the new connection, so that callbacks from the // router can be received over this new connection. @@ -890,7 +928,7 @@ public class RoutableReference extends Reference { connection.setAdapter(_routerInfo.getAdapter()); } - + return connection; } @@ -903,7 +941,7 @@ public class RoutableReference extends Reference callback.setException(new Ice.NoEndpointException(toString())); return; } - + // // Finally, create the connection. // @@ -914,13 +952,14 @@ public class RoutableReference extends Reference // Get an existing connection or create one if there's no // existing connection to one of the given endpoints. // - factory.create(endpoints, false, getEndpointSelection(), + factory.create(endpoints, false, getEndpointSelection(), new OutgoingConnectionFactory.CreateConnectionCallback() { - public void + @Override + public void setConnection(Ice.ConnectionI connection, boolean compress) { - // + // // If we have a router, set the object adapter for this router // (if any) to the new connection, so that callbacks from the // router can be received over this new connection. @@ -931,8 +970,9 @@ public class RoutableReference extends Reference } callback.setConnection(connection, compress); } - - public void + + @Override + public void setException(Ice.LocalException ex) { callback.setException(ex); @@ -948,14 +988,15 @@ public class RoutableReference extends Reference // create a new connection even if there's an existing // connection for one of the endpoints. // - - factory.create(new EndpointI[]{ endpoints[0] }, true, getEndpointSelection(), + + factory.create(new EndpointI[]{ endpoints[0] }, true, getEndpointSelection(), new OutgoingConnectionFactory.CreateConnectionCallback() { - public void + @Override + public void setConnection(Ice.ConnectionI connection, boolean compress) { - // + // // If we have a router, set the object adapter for this router // (if any) to the new connection, so that callbacks from the // router can be received over this new connection. @@ -966,21 +1007,22 @@ public class RoutableReference extends Reference } callback.setConnection(connection, compress); } - - public void + + @Override + public void setException(final Ice.LocalException ex) { if(_exception == null) { _exception = ex; } - + if(++_i == endpoints.length) { callback.setException(_exception); return; } - + final boolean more = _i != endpoints.length - 1; final EndpointI[] endpoint = new EndpointI[]{ endpoints[_i] }; factory.create(endpoint, more, getEndpointSelection(), this); @@ -998,7 +1040,8 @@ public class RoutableReference extends Reference { _preferSecure = preferSecure; } - + + @Override public int compare(EndpointI le, EndpointI re) { @@ -1034,7 +1077,7 @@ public class RoutableReference extends Reference private boolean _preferSecure; } - + private static EndpointComparator _preferNonSecureEndpointComparator = new EndpointComparator(false); private static EndpointComparator _preferSecureEndpointComparator = new EndpointComparator(true); private static EndpointI[] _emptyEndpoints = new EndpointI[0]; diff --git a/java/src/IceInternal/RouterInfo.java b/java/src/IceInternal/RouterInfo.java index 84856f1294f..f6c13dbfd00 100644 --- a/java/src/IceInternal/RouterInfo.java +++ b/java/src/IceInternal/RouterInfo.java @@ -39,6 +39,7 @@ public final class RouterInfo _identities.clear(); } + @Override public boolean equals(java.lang.Object obj) { @@ -55,6 +56,7 @@ public final class RouterInfo return false; } + @Override public int hashCode() { @@ -92,21 +94,23 @@ public final class RouterInfo { clientEndpoints = _clientEndpoints; } - + if(clientEndpoints != null) { callback.setEndpoints(clientEndpoints); return; } - + _router.begin_getClientProxy(new Ice.Callback_Router_getClientProxy() { + @Override public void response(Ice.ObjectPrx clientProxy) { callback.setEndpoints(setClientEndpoints(clientProxy)); } - + + @Override public void exception(Ice.LocalException ex) { @@ -125,7 +129,7 @@ public final class RouterInfo return _serverEndpoints; } } - + return setServerEndpoints(_router.getServerProxy()); } @@ -165,13 +169,15 @@ public final class RouterInfo _router.begin_addProxies(new Ice.ObjectPrx[] { proxy }, new Ice.Callback_Router_addProxies() { + @Override public void response(Ice.ObjectPrx[] evictedProxies) { addAndEvictProxies(proxy, evictedProxies); callback.addedProxy(); } - + + @Override public void exception(Ice.LocalException ex) { @@ -214,7 +220,7 @@ public final class RouterInfo else { clientProxy = clientProxy.ice_router(null); // The client proxy cannot be routed. - + // // In order to avoid creating a new connection to the // router, we must use the same timeout as the already @@ -224,7 +230,7 @@ public final class RouterInfo { clientProxy = clientProxy.ice_timeout(_router.ice_getConnection().timeout()); } - + _clientEndpoints = ((Ice.ObjectPrxHelperBase)clientProxy).__reference().getEndpoints(); } } @@ -238,7 +244,7 @@ public final class RouterInfo { throw new Ice.NoEndpointException(); } - + serverProxy = serverProxy.ice_router(null); // The server proxy cannot be routed. _serverEndpoints = ((Ice.ObjectPrxHelperBase)serverProxy).__reference().getEndpoints(); return _serverEndpoints; diff --git a/java/src/IceInternal/SOCKSNetworkProxy.java b/java/src/IceInternal/SOCKSNetworkProxy.java index de127616093..3a121ba88d9 100644 --- a/java/src/IceInternal/SOCKSNetworkProxy.java +++ b/java/src/IceInternal/SOCKSNetworkProxy.java @@ -22,6 +22,7 @@ public final class SOCKSNetworkProxy implements NetworkProxy _address = address; } + @Override public void beginWriteConnectRequest(java.net.InetSocketAddress endpoint, Buffer buf) { final java.net.InetAddress addr = endpoint.getAddress(); @@ -51,11 +52,13 @@ public final class SOCKSNetworkProxy implements NetworkProxy buf.b.order(order); } + @Override public void endWriteConnectRequest(Buffer buf) { buf.reset(); } + @Override public void beginReadConnectRequestResponse(Buffer buf) { // @@ -65,6 +68,7 @@ public final class SOCKSNetworkProxy implements NetworkProxy buf.b.position(0); } + @Override public void endReadConnectRequestResponse(Buffer buf) { buf.b.position(0); @@ -77,6 +81,7 @@ public final class SOCKSNetworkProxy implements NetworkProxy buf.reset(); } + @Override public NetworkProxy resolveHost() { assert(_host != null); @@ -87,12 +92,14 @@ public final class SOCKSNetworkProxy implements NetworkProxy false).get(0)); } + @Override public java.net.InetSocketAddress getAddress() { assert(_address != null); // Host must be resolved. return _address; } + @Override public String getName() { return "SOCKS"; diff --git a/java/src/IceInternal/SequencePatcher.java b/java/src/IceInternal/SequencePatcher.java index 2e63e79e3ec..ca75b0ed919 100644 --- a/java/src/IceInternal/SequencePatcher.java +++ b/java/src/IceInternal/SequencePatcher.java @@ -20,6 +20,7 @@ public class SequencePatcher implements Patcher, Ice.ReadObjectCallback _index = index; } + @Override public void patch(Ice.Object v) { @@ -38,12 +39,14 @@ public class SequencePatcher implements Patcher, Ice.ReadObjectCallback _seq[_index] = v; } + @Override public String type() { return _type; } + @Override public void invoke(Ice.Object v) { diff --git a/java/src/IceInternal/ServantManager.java b/java/src/IceInternal/ServantManager.java index 41cbb924698..0b188525d70 100644 --- a/java/src/IceInternal/ServantManager.java +++ b/java/src/IceInternal/ServantManager.java @@ -231,7 +231,7 @@ public final class ServantManager { Ice.ServantLocator l = null; assert(_instance != null); // Must not be called after destruction. - + l = _locatorMap.remove(category); if(l == null) { @@ -280,7 +280,7 @@ public final class ServantManager assert(_instance != null); // Must not be called after destruction. logger = _instance.initializationData().logger; _servantMapMap.clear(); - + locatorMap.putAll(_locatorMap); _locatorMap.clear(); _instance = null; diff --git a/java/src/IceInternal/TcpAcceptor.java b/java/src/IceInternal/TcpAcceptor.java index ef20c146dac..84c025301dd 100644 --- a/java/src/IceInternal/TcpAcceptor.java +++ b/java/src/IceInternal/TcpAcceptor.java @@ -11,11 +11,13 @@ package IceInternal; class TcpAcceptor implements Acceptor { + @Override public java.nio.channels.ServerSocketChannel fd() { return _fd; } + @Override public void close() { if(_instance.traceLevel() >= 1) @@ -29,6 +31,7 @@ class TcpAcceptor implements Acceptor _fd = null; } + @Override public void listen() { // Nothing to do. @@ -50,6 +53,7 @@ class TcpAcceptor implements Acceptor } } + @Override public Transceiver accept() { java.nio.channels.SocketChannel fd = Network.doAccept(_fd); @@ -65,11 +69,13 @@ class TcpAcceptor implements Acceptor return new TcpTransceiver(_instance, fd); } + @Override public String protocol() { return _instance.protocol(); } + @Override public String toString() { return Network.addrToString(_addr); @@ -122,6 +128,7 @@ class TcpAcceptor implements Acceptor } } + @Override protected synchronized void finalize() throws Throwable { diff --git a/java/src/IceInternal/TcpConnector.java b/java/src/IceInternal/TcpConnector.java index 4f199ec29a1..f8fca6619ba 100644 --- a/java/src/IceInternal/TcpConnector.java +++ b/java/src/IceInternal/TcpConnector.java @@ -11,6 +11,7 @@ package IceInternal; final class TcpConnector implements Connector { + @Override public Transceiver connect() { if(_instance.traceLevel() >= 2) @@ -39,16 +40,19 @@ final class TcpConnector implements Connector } } + @Override public short type() { return _instance.type(); } + @Override public String toString() { return Network.addrToString(_proxy == null ? _addr : _proxy.getAddress()); } + @Override public int hashCode() { return _hashCode; @@ -78,6 +82,7 @@ final class TcpConnector implements Connector _hashCode = IceInternal.HashUtil.hashAdd(_hashCode , _connectionId); } + @Override public boolean equals(java.lang.Object obj) { if(!(obj instanceof TcpConnector)) diff --git a/java/src/IceInternal/TcpEndpointFactory.java b/java/src/IceInternal/TcpEndpointFactory.java index d50fb5c37c7..c7caafdf56a 100644 --- a/java/src/IceInternal/TcpEndpointFactory.java +++ b/java/src/IceInternal/TcpEndpointFactory.java @@ -16,16 +16,19 @@ final class TcpEndpointFactory implements EndpointFactory _instance = instance; } + @Override public short type() { return _instance.type(); } + @Override public String protocol() { return _instance.protocol(); } + @Override public EndpointI create(java.util.ArrayList<String> args, boolean oaEndpoint) { IPEndpointI endpt = new TcpEndpointI(_instance); @@ -33,16 +36,19 @@ final class TcpEndpointFactory implements EndpointFactory return endpt; } + @Override public EndpointI read(BasicStream s) { return new TcpEndpointI(_instance, s); } + @Override public void destroy() { _instance = null; } + @Override public EndpointFactory clone(ProtocolInstance instance) { return new TcpEndpointFactory(instance); diff --git a/java/src/IceInternal/TcpEndpointI.java b/java/src/IceInternal/TcpEndpointI.java index fdbd187ee93..564e5292371 100644 --- a/java/src/IceInternal/TcpEndpointI.java +++ b/java/src/IceInternal/TcpEndpointI.java @@ -36,20 +36,24 @@ final class TcpEndpointI extends IPEndpointI // // Return the endpoint information. // + @Override public Ice.EndpointInfo getInfo() { Ice.TCPEndpointInfo info = new Ice.TCPEndpointInfo() { + @Override public short type() { return TcpEndpointI.this.type(); } + @Override public boolean datagram() { return TcpEndpointI.this.datagram(); } + @Override public boolean secure() { return TcpEndpointI.this.secure(); @@ -64,6 +68,7 @@ final class TcpEndpointI extends IPEndpointI // Return the timeout for the endpoint in milliseconds. 0 means // non-blocking, -1 means no timeout. // + @Override public int timeout() { return _timeout; @@ -74,6 +79,7 @@ final class TcpEndpointI extends IPEndpointI // that timeouts are supported by the endpoint. Otherwise the same // endpoint is returned. // + @Override public EndpointI timeout(int timeout) { if(timeout == _timeout) @@ -90,6 +96,7 @@ final class TcpEndpointI extends IPEndpointI // Return true if the endpoints support bzip2 compress, or false // otherwise. // + @Override public boolean compress() { return _compress; @@ -100,6 +107,7 @@ final class TcpEndpointI extends IPEndpointI // provided that compression is supported by the // endpoint. Otherwise the same endpoint is returned. // + @Override public EndpointI compress(boolean compress) { if(compress == _compress) @@ -115,6 +123,7 @@ final class TcpEndpointI extends IPEndpointI // // Return true if the endpoint is datagram-based. // + @Override public boolean datagram() { return false; @@ -123,6 +132,7 @@ final class TcpEndpointI extends IPEndpointI // // Return true if the endpoint is secure. // + @Override public boolean secure() { return false; @@ -135,6 +145,7 @@ final class TcpEndpointI extends IPEndpointI // "effective" endpoint, which might differ from this endpoint, // for example, if a dynamic port number is assigned. // + @Override public Transceiver transceiver(EndpointIHolder endpoint) { endpoint.value = this; @@ -148,6 +159,7 @@ final class TcpEndpointI extends IPEndpointI // from this endpoint, for example, if a dynamic port number is // assigned. // + @Override public Acceptor acceptor(EndpointIHolder endpoint, String adapterName) { TcpAcceptor p = new TcpAcceptor(_instance, _host, _port); @@ -155,6 +167,7 @@ final class TcpEndpointI extends IPEndpointI return p; } + @Override public String options() { // @@ -182,6 +195,7 @@ final class TcpEndpointI extends IPEndpointI // // Compare endpoints for sorting purposes // + @Override public int compareTo(EndpointI obj) // From java.lang.Comparable { if(!(obj instanceof TcpEndpointI)) @@ -216,6 +230,7 @@ final class TcpEndpointI extends IPEndpointI return super.compareTo(obj); } + @Override public void streamWriteImpl(BasicStream s) { super.streamWriteImpl(s); @@ -223,6 +238,7 @@ final class TcpEndpointI extends IPEndpointI s.writeBool(_compress); } + @Override public int hashInit(int h) { h = super.hashInit(h); @@ -231,6 +247,7 @@ final class TcpEndpointI extends IPEndpointI return h; } + @Override public void fillEndpointInfo(Ice.IPEndpointInfo info) { super.fillEndpointInfo(info); @@ -242,6 +259,7 @@ final class TcpEndpointI extends IPEndpointI } } + @Override protected boolean checkOption(String option, String argument, String endpoint) { if(super.checkOption(option, argument, endpoint)) @@ -291,11 +309,13 @@ final class TcpEndpointI extends IPEndpointI } } + @Override protected Connector createConnector(java.net.InetSocketAddress addr, NetworkProxy proxy) { return new TcpConnector(_instance, addr, proxy, _sourceAddr, _timeout, _connectionId); } + @Override protected IPEndpointI createEndpoint(String host, int port, String connectionId) { return new TcpEndpointI(_instance, host, port, _sourceAddr, _timeout, connectionId, _compress); diff --git a/java/src/IceInternal/TcpTransceiver.java b/java/src/IceInternal/TcpTransceiver.java index fd8bcc9ba54..bdaa5bca9a1 100644 --- a/java/src/IceInternal/TcpTransceiver.java +++ b/java/src/IceInternal/TcpTransceiver.java @@ -11,12 +11,14 @@ package IceInternal; final class TcpTransceiver implements Transceiver { + @Override public java.nio.channels.SelectableChannel fd() { assert(_fd != null); return _fd; } + @Override public int initialize(Buffer readBuffer, Buffer writeBuffer, Ice.BooleanHolder moreData) { try @@ -119,6 +121,7 @@ final class TcpTransceiver implements Transceiver return SocketOperation.None; } + @Override public int closing(boolean initiator, Ice.LocalException ex) { // If we are initiating the connection closure, wait for the peer @@ -126,6 +129,7 @@ final class TcpTransceiver implements Transceiver return initiator ? SocketOperation.Read : SocketOperation.None; } + @Override public void close() { if(_state == StateConnected && _instance.traceLevel() >= 1) @@ -149,6 +153,7 @@ final class TcpTransceiver implements Transceiver } } + @Override @SuppressWarnings("deprecation") public int write(Buffer buf) { @@ -234,6 +239,7 @@ final class TcpTransceiver implements Transceiver return SocketOperation.None; } + @Override @SuppressWarnings("deprecation") public int read(Buffer buf, Ice.BooleanHolder moreData) { @@ -285,16 +291,19 @@ final class TcpTransceiver implements Transceiver return SocketOperation.None; } + @Override public String protocol() { return _instance.protocol(); } + @Override public String toString() { return _desc; } + @Override public Ice.ConnectionInfo getInfo() { Ice.TCPConnectionInfo info = new Ice.TCPConnectionInfo(); @@ -312,6 +321,7 @@ final class TcpTransceiver implements Transceiver return info; } + @Override public void checkSendSize(Buffer buf, int messageSizeMax) { if(buf.size() > messageSizeMax) @@ -371,6 +381,7 @@ final class TcpTransceiver implements Transceiver } } + @Override protected synchronized void finalize() throws Throwable diff --git a/java/src/IceInternal/ThreadObserverI.java b/java/src/IceInternal/ThreadObserverI.java index 44471d34c8d..41bb79253f8 100644 --- a/java/src/IceInternal/ThreadObserverI.java +++ b/java/src/IceInternal/ThreadObserverI.java @@ -9,10 +9,11 @@ package IceInternal; -public class ThreadObserverI - extends IceMX.ObserverWithDelegate<IceMX.ThreadMetrics, Ice.Instrumentation.ThreadObserver> +public class ThreadObserverI + extends IceMX.ObserverWithDelegate<IceMX.ThreadMetrics, Ice.Instrumentation.ThreadObserver> implements Ice.Instrumentation.ThreadObserver { + @Override public void stateChanged(final Ice.Instrumentation.ThreadState oldState, final Ice.Instrumentation.ThreadState newState) { @@ -27,6 +28,7 @@ public class ThreadObserverI private MetricsUpdate<IceMX.ThreadMetrics> _threadStateUpdate = new MetricsUpdate<IceMX.ThreadMetrics>() { + @Override public void update(IceMX.ThreadMetrics v) { diff --git a/java/src/IceInternal/ThreadPool.java b/java/src/IceInternal/ThreadPool.java index 8d350b1e19c..e9554519655 100644 --- a/java/src/IceInternal/ThreadPool.java +++ b/java/src/IceInternal/ThreadPool.java @@ -13,6 +13,7 @@ public final class ThreadPool { final class ShutdownWorkItem implements ThreadPoolWorkItem { + @Override public void execute(ThreadPoolCurrent current) { current.ioCompleted(); @@ -34,6 +35,7 @@ public final class ThreadPool _handler = handler; } + @Override public void execute(ThreadPoolCurrent current) { _handler.finished(current); @@ -41,7 +43,7 @@ public final class ThreadPool private final EventHandler _handler; } - + static final class JoinThreadWorkItem implements ThreadPoolWorkItem { public @@ -49,19 +51,21 @@ public final class ThreadPool { _thread = thread; } - + + @Override public void execute(ThreadPoolCurrent current) { // No call to ioCompleted, this shouldn't block (and we don't want to cause // a new thread to be started). _thread.join(); } - + private final EventHandlerThread _thread; } - + static final class InterruptWorkItem implements ThreadPoolWorkItem { + @Override public void execute(ThreadPoolCurrent current) { // Nothing to do, this is just used to interrupt the thread pool selector. @@ -92,7 +96,7 @@ public final class ThreadPool _promote = true; _serialize = _instance.initializationData().properties.getPropertyAsInt(_prefix + ".Serialize") > 0; _serverIdleTime = timeout; - + Ice.Properties properties = _instance.initializationData().properties; String programName = properties.getProperty("Ice.ProgramName"); @@ -118,7 +122,7 @@ public final class ThreadPool String s = _prefix + ".Size < 1; Size adjusted to 1"; _instance.initializationData().logger.warning(s); size = 1; - } + } int sizeMax = properties.getPropertyAsIntWithDefault(_prefix + ".SizeMax", size); if(sizeMax == -1) @@ -131,7 +135,7 @@ public final class ThreadPool _instance.initializationData().logger.warning(s); sizeMax = size; } - + int sizeWarn = properties.getPropertyAsInt(_prefix + ".SizeWarn"); if(sizeWarn != 0 && sizeWarn < size) { @@ -182,14 +186,14 @@ public final class ThreadPool _workQueue = new ThreadPoolWorkQueue(this, _instance, _selector); _nextHandler = _handlers.iterator(); - + if(_instance.traceLevels().threadPool >= 1) { String s = "creating " + _prefix + ": Size = " + _size + ", SizeMax = " + _sizeMax + ", SizeWarn = " + _sizeWarn; _instance.initializationData().logger.trace(_instance.traceLevels().threadPoolCat, s); } - + try { for(int i = 0; i < _size; i++) @@ -217,6 +221,7 @@ public final class ThreadPool } } + @Override protected synchronized void finalize() throws Throwable @@ -452,7 +457,7 @@ public final class ThreadPool if(!current._ioCompleted) { // - // The handler didn't call ioCompleted() so we take care of decreasing + // The handler didn't call ioCompleted() so we take care of decreasing // the IO thread count now. // --_inUseIO; @@ -533,9 +538,9 @@ public final class ThreadPool if(current._handler == null) { // - // If there are no more ready handlers and there are still threads busy performing + // If there are no more ready handlers and there are still threads busy performing // IO, we give up leadership and promote another follower (which will perform the - // select() only once all the IOs are completed). Otherwise, if there's no more + // select() only once all the IOs are completed). Otherwise, if there's no more // threads peforming IOs, it's time to do another select(). // if(_inUseIO > 0) @@ -613,16 +618,16 @@ public final class ThreadPool assert(_inUse >= 0); ++_inUse; - + if(_inUse == _sizeWarn) { String s = "thread pool `" + _prefix + "' is running low on threads\n" + "Size=" + _size + ", " + "SizeMax=" + _sizeMax + ", " + "SizeWarn=" + _sizeWarn; _instance.initializationData().logger.warning(s); } - + if(!_destroyed) - { + { assert(_inUse <= _threads.size()); if(_inUse < _sizeMax && _inUse == _threads.size()) { @@ -631,7 +636,7 @@ public final class ThreadPool String s = "growing " + _prefix + ": Size=" + (_threads.size() + 1); _instance.initializationData().logger.trace(_instance.traceLevels().threadPoolCat, s); } - + try { EventHandlerThread thread = new EventHandlerThread(_threadPrefix + "-" + _threadIndex++); @@ -654,7 +659,7 @@ public final class ThreadPool } } } - + private synchronized void promoteFollower(ThreadPoolCurrent current) { @@ -681,7 +686,7 @@ public final class ThreadPool // current._handler = null; current.stream.reset(); - + // // Wait to be promoted and for all the IO threads to be done. // @@ -794,6 +799,7 @@ public final class ThreadPool _thread.start(); } + @Override public void run() { diff --git a/java/src/IceInternal/ThreadPoolCurrent.java b/java/src/IceInternal/ThreadPoolCurrent.java index 864f2ba4aab..06e739bfe85 100644 --- a/java/src/IceInternal/ThreadPoolCurrent.java +++ b/java/src/IceInternal/ThreadPoolCurrent.java @@ -25,7 +25,7 @@ public final class ThreadPoolCurrent public int operation; public BasicStream stream; // A per-thread stream to be used by event handlers for optimization. - public boolean + public boolean ioReady() { return (_handler._registered & operation) > 0; @@ -36,13 +36,13 @@ public final class ThreadPoolCurrent { _threadPool.ioCompleted(this); } - + public void dispatchFromThisThread(DispatchWorkItem workItem) { _threadPool.dispatchFromThisThread(workItem); } - + final ThreadPool _threadPool; final ThreadPool.EventHandlerThread _thread; EventHandler _handler; diff --git a/java/src/IceInternal/ThreadPoolWorkQueue.java b/java/src/IceInternal/ThreadPoolWorkQueue.java index ba3c19eaea8..3cf5bc4430e 100644 --- a/java/src/IceInternal/ThreadPoolWorkQueue.java +++ b/java/src/IceInternal/ThreadPoolWorkQueue.java @@ -34,6 +34,7 @@ final class ThreadPoolWorkQueue extends EventHandler _selector.update(this, SocketOperation.None, SocketOperation.Read); } + @Override protected synchronized void finalize() throws Throwable @@ -92,6 +93,7 @@ final class ThreadPoolWorkQueue extends EventHandler postMessage(); } + @Override public void message(ThreadPoolCurrent current) { @@ -131,19 +133,22 @@ final class ThreadPoolWorkQueue extends EventHandler throw new ThreadPool.DestroyedException(); } } - - public void + + @Override + public void finished(ThreadPoolCurrent current) { assert(false); } + @Override public String toString() { return "work queue"; } + @Override public java.nio.channels.SelectableChannel fd() { diff --git a/java/src/IceInternal/TraceUtil.java b/java/src/IceInternal/TraceUtil.java index 837faf50355..f3c269aa9d5 100644 --- a/java/src/IceInternal/TraceUtil.java +++ b/java/src/IceInternal/TraceUtil.java @@ -18,7 +18,7 @@ public final class TraceUtil { int p = str.pos(); str.pos(0); - + java.io.StringWriter s = new java.io.StringWriter(); byte type = printMessage(s, str); @@ -35,7 +35,7 @@ public final class TraceUtil { int p = str.pos(); str.pos(0); - + java.io.StringWriter s = new java.io.StringWriter(); byte type = printMessage(s, str); @@ -98,7 +98,7 @@ public final class TraceUtil { if(j < data.length) { - int n = (int)data[j]; + int n = data[j]; if(n < 0) { n += 256; @@ -176,7 +176,7 @@ public final class TraceUtil { s.write(" (oneway)"); } - + printRequestHeader(s, str); } @@ -185,7 +185,7 @@ public final class TraceUtil { int batchRequestNum = str.readInt(); s.write("\nnumber of requests = " + batchRequestNum); - + for(int i = 0; i < batchRequestNum; ++i) { s.write("\nrequest #" + i + ':'); @@ -198,10 +198,10 @@ public final class TraceUtil { int requestId = str.readInt(); s.write("\nrequest id = " + requestId); - + byte replyStatus = str.readByte(); s.write("\nreply status = " + (int)replyStatus + ' '); - + switch(replyStatus) { case ReplyStatus.replyOK: @@ -209,13 +209,13 @@ public final class TraceUtil s.write("(ok)"); break; } - + case ReplyStatus.replyUserException: { s.write("(user exception)"); break; } - + case ReplyStatus.replyObjectNotExist: case ReplyStatus.replyFacetNotExist: case ReplyStatus.replyOperationNotExist: @@ -227,26 +227,26 @@ public final class TraceUtil s.write("(object not exist)"); break; } - + case ReplyStatus.replyFacetNotExist: { s.write("(facet not exist)"); break; } - + case ReplyStatus.replyOperationNotExist: { s.write("(operation not exist)"); break; } - + default: { assert(false); break; } } - + printIdentityFacetOperation(s, str); break; } @@ -268,13 +268,13 @@ public final class TraceUtil s.write("(unknown local exception)"); break; } - + case ReplyStatus.replyUnknownUserException: { s.write("(unknown user exception)"); break; } - + default: { assert(false); @@ -311,19 +311,19 @@ public final class TraceUtil out.write("(normal)"); break; } - + case Nonmutating: { out.write("(nonmutating)"); break; } - + case Idempotent: { out.write("(idempotent)"); break; } - + default: { out.write("(unknown)"); @@ -343,7 +343,7 @@ public final class TraceUtil out.write(", "); } } - + Ice.EncodingVersion v = stream.skipEncaps(); if(!v.equals(Ice.Util.Encoding_1_0)) { @@ -364,19 +364,19 @@ public final class TraceUtil stream.readByte(); stream.readByte(); stream.readByte(); - + // byte pMajor = stream.readByte(); // byte pMinor = stream.readByte(); // out.write("\nprotocol version = " + (int)pMajor + "." + (int)pMinor); stream.readByte(); // major stream.readByte(); // minor - + // byte eMajor = stream.readByte(); // byte eMinor = stream.readByte(); // out.write("\nencoding version = " + (int)eMajor + "." + (int)eMinor); stream.readByte(); // major stream.readByte(); // minor - + byte type = stream.readByte(); try @@ -435,29 +435,29 @@ public final class TraceUtil // We're done. break; } - + case Protocol.requestMsg: { printRequest(s, str); break; } - + case Protocol.requestBatchMsg: { printBatchRequest(s, str); break; } - + case Protocol.replyMsg: { printReply(s, str); break; } - + default: { break; - } + } } return type; diff --git a/java/src/IceInternal/Transceiver.java b/java/src/IceInternal/Transceiver.java index ad372615208..dc0afa96fb1 100644 --- a/java/src/IceInternal/Transceiver.java +++ b/java/src/IceInternal/Transceiver.java @@ -21,6 +21,7 @@ public interface Transceiver int read(Buffer buf, Ice.BooleanHolder moreData); String protocol(); + @Override String toString(); Ice.ConnectionInfo getInfo(); void checkSendSize(Buffer buf, int messageSizeMax); diff --git a/java/src/IceInternal/TwowayCallback.java b/java/src/IceInternal/TwowayCallback.java index 368f3600a04..86c6afb6202 100644 --- a/java/src/IceInternal/TwowayCallback.java +++ b/java/src/IceInternal/TwowayCallback.java @@ -15,11 +15,13 @@ public abstract class TwowayCallback extends CallbackBase implements Ice.TwowayC { } + @Override public void exception(Ice.SystemException __ex) { exception(new Ice.UnknownException(__ex)); } + @Override public final void __sent(Ice.AsyncResult __result) { sent(__result.sentSynchronously()); diff --git a/java/src/IceInternal/UdpConnector.java b/java/src/IceInternal/UdpConnector.java index 0bcd3a536e9..e42e75561de 100644 --- a/java/src/IceInternal/UdpConnector.java +++ b/java/src/IceInternal/UdpConnector.java @@ -11,6 +11,7 @@ package IceInternal; final class UdpConnector implements Connector { + @Override public Transceiver connect() { return new UdpTransceiver(_instance, _addr, _sourceAddr, _mcastInterface, _mcastTtl); @@ -22,16 +23,19 @@ final class UdpConnector implements Connector return null; } + @Override public short type() { return _instance.type(); } + @Override public String toString() { return Network.addrToString(_addr); } + @Override public int hashCode() { return _hashCode; @@ -62,6 +66,7 @@ final class UdpConnector implements Connector _hashCode = IceInternal.HashUtil.hashAdd(_hashCode , _connectionId); } + @Override public boolean equals(java.lang.Object obj) { if(!(obj instanceof UdpConnector)) diff --git a/java/src/IceInternal/UdpEndpointFactory.java b/java/src/IceInternal/UdpEndpointFactory.java index 8e4301d358b..97815a9aff5 100644 --- a/java/src/IceInternal/UdpEndpointFactory.java +++ b/java/src/IceInternal/UdpEndpointFactory.java @@ -16,16 +16,19 @@ final class UdpEndpointFactory implements EndpointFactory _instance = instance; } + @Override public short type() { return _instance.type(); } + @Override public String protocol() { return _instance.protocol(); } + @Override public EndpointI create(java.util.ArrayList<String> args, boolean oaEndpoint) { IPEndpointI endpt = new UdpEndpointI(_instance); @@ -33,16 +36,19 @@ final class UdpEndpointFactory implements EndpointFactory return endpt; } + @Override public EndpointI read(BasicStream s) { return new UdpEndpointI(_instance, s); } + @Override public void destroy() { _instance = null; } + @Override public EndpointFactory clone(ProtocolInstance instance) { return new UdpEndpointFactory(instance); diff --git a/java/src/IceInternal/UdpEndpointI.java b/java/src/IceInternal/UdpEndpointI.java index 8d17a61c19c..44cb3b6988a 100644 --- a/java/src/IceInternal/UdpEndpointI.java +++ b/java/src/IceInternal/UdpEndpointI.java @@ -47,20 +47,24 @@ final class UdpEndpointI extends IPEndpointI // // Return the endpoint information. // + @Override public Ice.EndpointInfo getInfo() { Ice.UDPEndpointInfo info = new Ice.UDPEndpointInfo() { + @Override public short type() { return UdpEndpointI.this.type(); } + @Override public boolean datagram() { return UdpEndpointI.this.datagram(); } + @Override public boolean secure() { return UdpEndpointI.this.secure(); @@ -75,6 +79,7 @@ final class UdpEndpointI extends IPEndpointI // Return the timeout for the endpoint in milliseconds. 0 means // non-blocking, -1 means no timeout. // + @Override public int timeout() { return -1; @@ -85,6 +90,7 @@ final class UdpEndpointI extends IPEndpointI // that timeouts are supported by the endpoint. Otherwise the same // endpoint is returned. // + @Override public EndpointI timeout(int timeout) { return this; @@ -94,6 +100,7 @@ final class UdpEndpointI extends IPEndpointI // Return true if the endpoints support bzip2 compress, or false // otherwise. // + @Override public boolean compress() { return _compress; @@ -104,6 +111,7 @@ final class UdpEndpointI extends IPEndpointI // provided that compression is supported by the // endpoint. Otherwise the same endpoint is returned. // + @Override public EndpointI compress(boolean compress) { if(compress == _compress) @@ -120,6 +128,7 @@ final class UdpEndpointI extends IPEndpointI // // Return true if the endpoint is datagram-based. // + @Override public boolean datagram() { return true; @@ -128,6 +137,7 @@ final class UdpEndpointI extends IPEndpointI // // Return true if the endpoint is secure. // + @Override public boolean secure() { return false; @@ -140,6 +150,7 @@ final class UdpEndpointI extends IPEndpointI // "effective" endpoint, which might differ from this endpoint, // for example, if a dynamic port number is assigned. // + @Override public Transceiver transceiver(EndpointIHolder endpoint) { UdpTransceiver p = new UdpTransceiver(_instance, _host, _port, _mcastInterface, _connect); @@ -154,6 +165,7 @@ final class UdpEndpointI extends IPEndpointI // from this endpoint, for example, if a dynamic port number is // assigned. // + @Override public Acceptor acceptor(EndpointIHolder endpoint, String adapterName) { endpoint.value = this; @@ -163,6 +175,7 @@ final class UdpEndpointI extends IPEndpointI // // Convert the endpoint to its string form // + @Override public String options() { // @@ -197,6 +210,7 @@ final class UdpEndpointI extends IPEndpointI return s; } + @Override public int compareTo(EndpointI obj) // From java.lang.Comparable { if(!(obj instanceof UdpEndpointI)) @@ -249,6 +263,7 @@ final class UdpEndpointI extends IPEndpointI // // Marshal the endpoint // + @Override public void streamWriteImpl(BasicStream s) { super.streamWriteImpl(s); @@ -262,6 +277,7 @@ final class UdpEndpointI extends IPEndpointI s.writeBool(_compress); } + @Override public int hashInit(int h) { h = super.hashInit(h); @@ -272,6 +288,7 @@ final class UdpEndpointI extends IPEndpointI return h; } + @Override public void fillEndpointInfo(Ice.IPEndpointInfo info) { super.fillEndpointInfo(info); @@ -285,6 +302,7 @@ final class UdpEndpointI extends IPEndpointI } } + @Override protected boolean checkOption(String option, String argument, String endpoint) { if(super.checkOption(option, argument, endpoint)) @@ -372,11 +390,13 @@ final class UdpEndpointI extends IPEndpointI return true; } + @Override protected Connector createConnector(java.net.InetSocketAddress addr, NetworkProxy proxy) { return new UdpConnector(_instance, addr, _sourceAddr, _mcastInterface, _mcastTtl, _connectionId); } + @Override protected IPEndpointI createEndpoint(String host, int port, String connectionId) { return new UdpEndpointI(_instance, host, port, _sourceAddr, _mcastInterface,_mcastTtl, _connect, diff --git a/java/src/IceInternal/UdpTransceiver.java b/java/src/IceInternal/UdpTransceiver.java index 80fea501e67..ff4917d33c1 100644 --- a/java/src/IceInternal/UdpTransceiver.java +++ b/java/src/IceInternal/UdpTransceiver.java @@ -11,12 +11,14 @@ package IceInternal; final class UdpTransceiver implements Transceiver { + @Override public java.nio.channels.SelectableChannel fd() { assert(_fd != null); return _fd; } + @Override public int initialize(Buffer readBuffer, Buffer writeBuffer, Ice.BooleanHolder moreData) { // @@ -25,6 +27,7 @@ final class UdpTransceiver implements Transceiver return SocketOperation.None; } + @Override public int closing(boolean initiator, Ice.LocalException ex) { // @@ -33,6 +36,7 @@ final class UdpTransceiver implements Transceiver return SocketOperation.None; } + @Override public void close() { assert(_fd != null); @@ -53,6 +57,7 @@ final class UdpTransceiver implements Transceiver _fd = null; } + @Override @SuppressWarnings("deprecation") public int write(Buffer buf) { @@ -129,6 +134,7 @@ final class UdpTransceiver implements Transceiver return SocketOperation.None; } + @Override @SuppressWarnings("deprecation") public int read(Buffer buf, Ice.BooleanHolder moreData) { @@ -203,11 +209,13 @@ final class UdpTransceiver implements Transceiver return SocketOperation.None; } + @Override public String protocol() { return _instance.protocol(); } + @Override public String toString() { if(_fd == null) @@ -218,7 +226,7 @@ final class UdpTransceiver implements Transceiver String s; if(_state == StateNotConnected) { - java.net.DatagramSocket socket = ((java.nio.channels.DatagramChannel)_fd).socket(); + java.net.DatagramSocket socket = _fd.socket(); s = "local address = " + Network.addrToString((java.net.InetSocketAddress)socket.getLocalSocketAddress()); if(_peerAddr != null) { @@ -237,6 +245,7 @@ final class UdpTransceiver implements Transceiver return s; } + @Override public Ice.ConnectionInfo getInfo() { Ice.UDPConnectionInfo info = new Ice.UDPConnectionInfo(); @@ -270,6 +279,7 @@ final class UdpTransceiver implements Transceiver return info; } + @Override public void checkSendSize(Buffer buf, int messageSizeMax) { if(buf.size() > messageSizeMax) @@ -593,6 +603,7 @@ final class UdpTransceiver implements Transceiver } } + @Override protected synchronized void finalize() throws Throwable { diff --git a/java/src/IceInternal/Util.java b/java/src/IceInternal/Util.java index ea4fab28a12..4bd8ef592e2 100644 --- a/java/src/IceInternal/Util.java +++ b/java/src/IceInternal/Util.java @@ -48,7 +48,7 @@ public final class Util catch(IllegalArgumentException ex) { // - // With JDK-7 this can happen if the result url (base url + path) produces a + // With JDK-7 this can happen if the result url (base url + path) produces a // malformed url for an URLClassLoader. For example the code in following // comment will produce this exception under Windows. // |