Java 类org.apache.curator.framework.recipes.queue.QueueSerializer 实例源码

项目:ZKRecipesByExample    文件:DistributedQueueExample.java   
private static QueueSerializer<String> createQueueSerializer() {
    return new QueueSerializer<String>(){

        @Override
        public byte[] serialize(String item) {
            return item.getBytes();
        }

        @Override
        public String deserialize(byte[] bytes) {
            return new String(bytes);
        }

    };
}
项目:ZKRecipesByExample    文件:DistributedDelayQueueExample.java   
private static QueueSerializer<String> createQueueSerializer() {
    return new QueueSerializer<String>() {

        @Override
        public byte[] serialize(String item) {
            return item.getBytes();
        }

        @Override
        public String deserialize(byte[] bytes) {
            return new String(bytes);
        }

    };
}
项目:ZKRecipesByExample    文件:AkinDistributedBlockingQueueExample.java   
private static QueueSerializer<String> createQueueSerializer() {
    return new QueueSerializer<String>(){

        @Override
        public byte[] serialize(String item) {
            return item.getBytes();
        }

        @Override
        public String deserialize(byte[] bytes) {
            return new String(bytes);
        }

    };
}
项目:ZKRecipesByExample    文件:DistributedIdQueueExample.java   
private static QueueSerializer<String> createQueueSerializer() {
    return new QueueSerializer<String>(){

        @Override
        public byte[] serialize(String item) {
            return item.getBytes();
        }

        @Override
        public String deserialize(byte[] bytes) {
            return new String(bytes);
        }

    };
}
项目:ZKRecipesByExample    文件:DistributedPriorityQueueExample.java   
private static QueueSerializer<String> createQueueSerializer() {
    return new QueueSerializer<String>(){

        @Override
        public byte[] serialize(String item) {
            return item.getBytes();
        }

        @Override
        public String deserialize(byte[] bytes) {
            return new String(bytes);
        }

    };
}