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 ServiceExceptiondecodeFromWire(int pos, Buffer buffer)Called by Vert.x when a message is decoded from the wire.voidencodeToWire(Buffer buffer, ServiceException body)Called by Vert.x when marshalling a message to the wire.Stringname()The codec name.bytesystemCodecID()Used to identify system codecs.ServiceExceptiontransform(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:MessageCodecCalled by Vert.x when marshalling a message to the wire.- Specified by:
encodeToWirein 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:MessageCodecCalled by Vert.x when a message is decoded from the wire.- Specified by:
decodeFromWirein 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:MessageCodecIf 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:
transformin interfaceMessageCodec<ServiceException,ServiceException>- Parameters:
exception- the sent message- Returns:
- the transformed message
-
name
public String name()
Description copied from interface:MessageCodecThe 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:
namein interfaceMessageCodec<ServiceException,ServiceException>- Returns:
- the name
-
systemCodecID
public byte systemCodecID()
Description copied from interface:MessageCodecUsed to identify system codecs. Should always return -1 for a user codec.- Specified by:
systemCodecIDin interfaceMessageCodec<ServiceException,ServiceException>- Returns:
- -1 for a user codec.
-
-