Package io.vertx.serviceproxy
Class ServiceExceptionMessageCodec
- java.lang.Object
-
- io.vertx.serviceproxy.ServiceExceptionMessageCodec
-
- All Implemented Interfaces:
MessageCodec<ServiceException,ServiceException>
public class ServiceExceptionMessageCodec extends Object implements MessageCodec<ServiceException,ServiceException>
A MessageCodec for ServiceException- Author:
- Dan O'Reilly
-
-
Constructor Summary
Constructors Constructor Description ServiceExceptionMessageCodec()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ServiceException
decodeFromWire(int pos, Buffer buffer)
Called by Vert.x when a message is decoded from the wire.void
encodeToWire(Buffer buffer, ServiceException body)
Called by Vert.x when marshalling a message to the wire.String
name()
The codec name.byte
systemCodecID()
Used to identify system codecs.ServiceException
transform(ServiceException exception)
If a message is sent locally across the event bus, this method is called to transform the message from the sent type S to the received type R
-
-
-
Method Detail
-
encodeToWire
public void encodeToWire(Buffer buffer, ServiceException body)
Description copied from interface:MessageCodec
Called by Vert.x when marshalling a message to the wire.- Specified by:
encodeToWire
in interfaceMessageCodec<ServiceException,ServiceException>
- Parameters:
buffer
- the message should be written into this bufferbody
- the message that is being sent
-
decodeFromWire
public ServiceException decodeFromWire(int pos, Buffer buffer)
Description copied from interface:MessageCodec
Called by Vert.x when a message is decoded from the wire.- Specified by:
decodeFromWire
in interfaceMessageCodec<ServiceException,ServiceException>
- Parameters:
pos
- the position in the buffer where the message should be read from.buffer
- the buffer to read the message from- Returns:
- the read message
-
transform
public ServiceException transform(ServiceException exception)
Description copied from interface:MessageCodec
If a message is sent locally across the event bus, this method is called to transform the message from the sent type S to the received type R- Specified by:
transform
in interfaceMessageCodec<ServiceException,ServiceException>
- Parameters:
exception
- the sent message- Returns:
- the transformed message
-
name
public String name()
Description copied from interface:MessageCodec
The codec name. Each codec must have a unique name. This is used to identify a codec when sending a message and for unregistering codecs.- Specified by:
name
in interfaceMessageCodec<ServiceException,ServiceException>
- Returns:
- the name
-
systemCodecID
public byte systemCodecID()
Description copied from interface:MessageCodec
Used to identify system codecs. Should always return -1 for a user codec.- Specified by:
systemCodecID
in interfaceMessageCodec<ServiceException,ServiceException>
- Returns:
- -1 for a user codec.
-
-