Package org.infinispan.marshall.jboss.externalizers

Source Code of org.infinispan.marshall.jboss.externalizers.SuccessfulResponseExternalizer

package org.infinispan.marshall.jboss.externalizers;

import net.jcip.annotations.Immutable;

import org.infinispan.marshall.jboss.Externalizer;
import org.infinispan.remoting.responses.SuccessfulResponse;
import org.jboss.marshalling.Marshaller;
import org.jboss.marshalling.Unmarshaller;

import java.io.IOException;

/**
* Externalizes a SuccessfulResponse
*
* @author Manik Surtani
* @since 4.0
*/
@Immutable
public class SuccessfulResponseExternalizer implements Externalizer {

   public void writeObject(Marshaller output, Object subject) throws IOException {
      SuccessfulResponse sr = (SuccessfulResponse) subject;
      output.writeObject(sr.getResponseValue());     
   }

   public Object readObject(Unmarshaller input) throws IOException, ClassNotFoundException {
      SuccessfulResponse sr = new SuccessfulResponse();
      sr.setResponseValue(input.readObject());
      return sr;
   }

}
TOP

Related Classes of org.infinispan.marshall.jboss.externalizers.SuccessfulResponseExternalizer

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.