diff options
author | Jon Bratseth <bratseth@gmail.com> | 2020-10-08 11:32:33 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2020-10-08 11:32:33 +0200 |
commit | 5762dd1702e10d1c68fd920665e822b25568cd9c (patch) | |
tree | 80f77ffb1bb4b60f1a1fa701df4d46b27b84729f /messagebus | |
parent | f2e89d3361cae0e2e74bac89405a175d6ecf5e98 (diff) |
Log warning with exception instead of doing printStackTrace
Diffstat (limited to 'messagebus')
-rw-r--r-- | messagebus/src/main/java/com/yahoo/messagebus/ErrorCode.java | 4 | ||||
-rw-r--r-- | messagebus/src/main/java/com/yahoo/messagebus/Protocol.java | 33 |
2 files changed, 17 insertions, 20 deletions
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); + } |