org.apache.activemq.artemis.spi.core.protocol

## Class MessagePersister

- java.lang.Object
- - org.apache.activemq.artemis.spi.core.protocol.MessagePersister

- All Implemented Interfaces:
    org.apache.activemq.artemis.core.persistence.Persister<Message>

      public class MessagePersister
      extends Object
      implements org.apache.activemq.artemis.core.persistence.Persister<Message>

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `MessagePersister()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `clearPersisters()`
    `Message` | `decode(ActiveMQBuffer buffer, Message record)`
    `void` | `encode(ActiveMQBuffer buffer, Message record)` Sub classes must add the first short as the protocol-id
    `int` | `getEncodeSize(Message record)`
    `static MessagePersister` | `getInstance()`
    `static org.apache.activemq.artemis.core.persistence.Persister` | `getPersister(byte id)`
    `static void` | `registerPersister(org.apache.activemq.artemis.core.persistence.Persister<Message> persister)`
    `static void` | `registerProtocol(ProtocolManagerFactory manager)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.activemq.artemis.core.persistence.Persister

      `getID`

- - ### Constructor Detail

    - #### MessagePersister

          protected MessagePersister()

  - ### Method Detail

    - #### registerProtocol

          public static void registerProtocol(ProtocolManagerFactory manager)

    - #### clearPersisters

          public static void clearPersisters()

    - #### getPersister

          public static org.apache.activemq.artemis.core.persistence.Persister getPersister(byte id)

    - #### registerPersister

          public static void registerPersister(org.apache.activemq.artemis.core.persistence.Persister<Message> persister)

    - #### getInstance

          public static MessagePersister getInstance()

    - #### getEncodeSize

          public int getEncodeSize(Message record)

      Specified by:
        `getEncodeSize` in interface `org.apache.activemq.artemis.core.persistence.Persister<Message>`

    - #### encode

          public void encode(ActiveMQBuffer buffer,
                             Message record)

      Sub classes must add the first short as the protocol-id
      Specified by:
        `encode` in interface `org.apache.activemq.artemis.core.persistence.Persister<Message>`

    - #### decode

          public Message decode(ActiveMQBuffer buffer,
                                Message record)

      Specified by:
        `decode` in interface `org.apache.activemq.artemis.core.persistence.Persister<Message>`

Copyright © 2017 The Apache Software Foundation. All rights reserved.