Ignore:
Timestamp:
07/08/13 13:29:24 (11 years ago)
Author:
stoda
Message:

J

Location:
trunk/src/main/java/omq/common/util/Serializers
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/main/java/omq/common/util/Serializers/GsonImp.java

    r75 r83  
    1515import com.google.gson.JsonParser;
    1616
     17/**
     18 * Json serialize implementation. It uses the Gson libraries.
     19 *
     20 * @author Sergi Toda <sergi.toda@estudiants.urv.cat>
     21 *
     22 */
    1723public class GsonImp implements ISerializer {
    1824        private final Gson gson = new Gson();
  • trunk/src/main/java/omq/common/util/Serializers/ISerializer.java

    r72 r83  
    77
    88/**
     9 * An ISerializer object can serialize any kind of objects and deserialize
     10 * Requests and Responses.
    911 *
    1012 * @author Sergi Toda <sergi.toda@estudiants.urv.cat>
     
    1214 */
    1315public interface ISerializer {
     16        /**
     17         * Serialize
     18         *
     19         * @param obj
     20         *            - object to serialize
     21         * @return objectSerialized
     22         * @throws SerializerException
     23         *             - If the serialization failed
     24         */
    1425        public byte[] serialize(Object obj) throws SerializerException;
    1526
     27        /**
     28         * Deserialize a Request
     29         *
     30         * @param bytes
     31         *            - serialized request
     32         * @param obj
     33         *            - remoteObject which is receiving requests
     34         * @return request
     35         * @throws SerializerException
     36         *             - If the serialization failed
     37         */
    1638        public Request deserializeRequest(byte[] bytes, RemoteObject obj) throws SerializerException;
    1739
     40        /**
     41         * Deserialize a Response
     42         *
     43         * @param bytes
     44         *            serialized response
     45         * @param type
     46         *            - return type expected
     47         * @return response
     48         * @throws SerializerException
     49         *             - If the serialization failed
     50         */
    1851        public Response deserializeResponse(byte[] bytes, Class<?> type) throws SerializerException;
    1952}
  • trunk/src/main/java/omq/common/util/Serializers/JavaImp.java

    r72 r83  
    1212
    1313/**
     14 * Java serialize implementation. It uses the default java serialization.
    1415 *
    1516 * @author Sergi Toda <sergi.toda@estudiants.urv.cat>
  • trunk/src/main/java/omq/common/util/Serializers/KryoImp.java

    r72 r83  
    1313
    1414/**
     15 * Kryo serializerimplementation. It uses the Kryo libraries.
    1516 *
    1617 * @author Sergi Toda <sergi.toda@estudiants.urv.cat>
Note: See TracChangeset for help on using the changeset viewer.