Class CommandLineSerializer


  • public final class CommandLineSerializer
    extends Object
    Serializes and deserializes WorkerRequests as base64 encoded strings so they can be passed on the command line to the worker.

    Java serialization is a appropriate in this use-case because there are no compatibility concerns. The messages encoded/decoded by this class are only used to communicate with another JVM that is running with the same version of the java classes. Also, it should be lighter weight and faster than other common serialization solutions.

    • Method Detail

      • render

        public static String render​(WorkerRequest message)
        Returns the given serializable object as a base64 encoded String.
      • parse

        public static WorkerRequest parse​(String arg)
        Parses the given base64 encoded string as an object of the given type.