From 5762dd1702e10d1c68fd920665e822b25568cd9c Mon Sep 17 00:00:00 2001 From: Jon Bratseth Date: Thu, 8 Oct 2020 11:32:33 +0200 Subject: Log warning with exception instead of doing printStackTrace --- .../main/java/com/yahoo/messagebus/ErrorCode.java | 4 +-- .../main/java/com/yahoo/messagebus/Protocol.java | 33 ++++++++++------------ 2 files changed, 17 insertions(+), 20 deletions(-) (limited to 'messagebus') diff --git a/messagebus/src/main/java/com/yahoo/messagebus/ErrorCode.java b/messagebus/src/main/java/com/yahoo/messagebus/ErrorCode.java index 460783457af..9bde5e32fd7 100644 --- a/messagebus/src/main/java/com/yahoo/messagebus/ErrorCode.java +++ b/messagebus/src/main/java/com/yahoo/messagebus/ErrorCode.java @@ -59,10 +59,10 @@ public final class ErrorCode { /** The protocol specified for the message is unknown. */ public static final int UNKNOWN_PROTOCOL = FATAL_ERROR + 7; - /** An error occured while decoding the message. */ + /** An error occurred while decoding the message. */ public static final int DECODE_ERROR = FATAL_ERROR + 8; - /** A timeout occured while sending. */ + /** A timeout occurred while sending. */ public static final int TIMEOUT = FATAL_ERROR + 9; /** The target is running an incompatible version. */ diff --git a/messagebus/src/main/java/com/yahoo/messagebus/Protocol.java b/messagebus/src/main/java/com/yahoo/messagebus/Protocol.java index 3801308d38f..d1c19cda88c 100644 --- a/messagebus/src/main/java/com/yahoo/messagebus/Protocol.java +++ b/messagebus/src/main/java/com/yahoo/messagebus/Protocol.java @@ -12,37 +12,34 @@ import com.yahoo.messagebus.routing.RoutingPolicy; */ public interface Protocol { - /** - * Returns a global unique name for this protocol. - * - * @return The name. - */ - public String getName(); + /** Returns a global unique name for this protocol. */ + String getName(); /** * Encodes the protocol specific data of a routable into a byte array. * - * @param version The version to encode for. - * @param routable The routable to encode. - * @return The encoded data. + * @param version the version to encode for + * @param routable the routable to encode + * @return the encoded data */ - public byte[] encode(Version version, Routable routable); + byte[] encode(Version version, Routable routable); /** * Decodes the protocol specific data into a routable of the correct type. * - * @param version The version of the serialized routable. - * @param payload The payload to decode from. - * @return The decoded routable. + * @param version the version of the serialized routable + * @param payload the payload to decode from + * @return the decoded routable, or null if it could not be decoded */ - public Routable decode(Version version, byte[] payload); + Routable decode(Version version, byte[] payload); /** * Create a policy of the named type with the named param passed to the constructor of that policy. * - * @param name The name of the policy to create. - * @param param The parameter to that policy's constructor. - * @return The created policy. + * @param name the name of the policy to create + * @param param the parameter to that policy's constructor + * @return the created policy */ - public RoutingPolicy createPolicy(String name, String param); + RoutingPolicy createPolicy(String name, String param); + } -- cgit v1.2.3