Class AbstractNodeNameAwareMarshaller

    • Constructor Detail

      • AbstractNodeNameAwareMarshaller

        public AbstractNodeNameAwareMarshaller()
    • Method Detail

      • nodeName

        public void nodeName​(@Nullable
                             @Nullable String nodeName)
        Set node name.
        Parameters:
        nodeName - Node name.
      • marshal

        public byte[] marshal​(@Nullable
                              @Nullable Object obj)
                       throws IgniteCheckedException
        Marshals object to byte array.
        Parameters:
        obj - Object to marshal. null object will be marshaled to binary null representation.
        Returns:
        Byte array.
        Throws:
        IgniteCheckedException - If marshalling failed.
      • marshal

        public void marshal​(@Nullable
                            @Nullable Object obj,
                            OutputStream out)
                     throws IgniteCheckedException
        Marshals object to the output stream. This method should not close given output stream.
        Parameters:
        obj - Object to marshal. null object will be marshaled to binary null representation.
        out - Output stream to marshal into.
        Throws:
        IgniteCheckedException - If marshalling failed.
      • unmarshal

        public <T> T unmarshal​(byte[] arr,
                               @Nullable
                               @Nullable ClassLoader clsLdr)
                        throws IgniteCheckedException
        Unmarshals object from byte array using given class loader.
        Type Parameters:
        T - Type of unmarshalled object.
        Parameters:
        arr - Byte array.
        clsLdr - If not null then given class loader will be used for unmarshal object.
        Returns:
        Unmarshalled object.
        Throws:
        IgniteCheckedException - If unmarshalling failed.
      • unmarshal

        public <T> T unmarshal​(InputStream in,
                               @Nullable
                               @Nullable ClassLoader clsLdr)
                        throws IgniteCheckedException
        Unmarshals object from the input stream using given class loader. This method should not close given input stream.
        Type Parameters:
        T - Type of unmarshalled object.
        Parameters:
        in - Input stream.
        clsLdr - If not null then given class loader will be used for unmarshal object.
        Returns:
        Unmarshalled object.
        Throws:
        IgniteCheckedException - If unmarshalling failed.
      • marshal0

        protected abstract void marshal0​(@Nullable
                                         @Nullable Object obj,
                                         OutputStream out)
                                  throws IgniteCheckedException
        Marshals object to the output stream. This method should not close given output stream.
        Parameters:
        obj - Object to marshal. null object will be marshaled to binary null representation.
        out - Output stream to marshal into.
        Throws:
        IgniteCheckedException - If marshalling failed.
      • marshal0

        protected abstract byte[] marshal0​(@Nullable
                                           @Nullable Object obj)
                                    throws IgniteCheckedException
        Marshals object to byte array.
        Parameters:
        obj - Object to marshal. null object will be marshaled to binary null representation.
        Returns:
        Byte array.
        Throws:
        IgniteCheckedException - If marshalling failed.
      • unmarshal0

        protected abstract <T> T unmarshal0​(InputStream in,
                                            @Nullable
                                            @Nullable ClassLoader clsLdr)
                                     throws IgniteCheckedException
        Unmarshals object from the input stream using given class loader. This method should not close given input stream.
        Type Parameters:
        T - Type of unmarshalled object.
        Parameters:
        in - Input stream.
        clsLdr - If not null then given class loader will be used for unmarshal object.
        Returns:
        Unmarshalled object.
        Throws:
        IgniteCheckedException - If unmarshalling failed.
      • unmarshal0

        protected abstract <T> T unmarshal0​(byte[] arr,
                                            @Nullable
                                            @Nullable ClassLoader clsLdr)
                                     throws IgniteCheckedException
        Unmarshals object from byte array using given class loader.
        Type Parameters:
        T - Type of unmarshalled object.
        Parameters:
        arr - Byte array.
        clsLdr - If not null then given class loader will be used for unmarshal object.
        Returns:
        Unmarshalled object.
        Throws:
        IgniteCheckedException - If unmarshalling failed.