Package org.infinispan.protostream

Examples of org.infinispan.protostream.ConfigurationBuilder


   private SerializationContext serCtx;

   @Before
   public void setUp() throws Exception {
      serCtx = ProtobufUtil.newSerializationContext(new ConfigurationBuilder().build());
      MarshallerRegistration.registerMarshallers(serCtx);
   }
View Full Code Here


   private SerializationContext serCtx;

   @Before
   public void setUp() throws Exception {
      serCtx = ProtobufUtil.newSerializationContext(new ConfigurationBuilder().build());
      serCtx.registerProtofile(PROTOBUF_RES);
      serCtx.registerMarshaller(new AddressMarshaller());
      serCtx.registerMarshaller(new PhoneNumberMarshaller());
      serCtx.registerMarshaller(new PersonMarshaller());
   }
View Full Code Here

   private SerializationContext serCtx;

   @Before
   public void setUp() throws Exception {
      serCtx = ProtobufUtil.newSerializationContext(new ConfigurationBuilder().build());
      MarshallerRegistration.registerMarshallers(serCtx);
   }
View Full Code Here

*/
public class ProtobufParsingTest extends AbstractParsingTest {

   @Override
   protected FilterProcessingChain<Descriptor> createFilterProcessingChain() throws IOException, DescriptorParserException {
      SerializationContext serCtx = ProtobufUtil.newSerializationContext(new ConfigurationBuilder().build());
      MarshallerRegistration.registerMarshallers(serCtx);
      EntityNamesResolver entityNamesResolver = new ProtobufEntityNamesResolver(serCtx);
      ProtobufPropertyHelper protobufPropertyHelper = new ProtobufPropertyHelper(entityNamesResolver, serCtx);
      return FilterProcessingChain.build(entityNamesResolver, protobufPropertyHelper, null);
   }
View Full Code Here

* @since 2.0
*/
public class SerializationContextImplTest {

   private SerializationContextImpl createContext() {
      return (SerializationContextImpl) ProtobufUtil.newSerializationContext(new ConfigurationBuilder().build());
   }
View Full Code Here

* @since 1.0
*/
public abstract class AbstractProtoStreamTest {

   protected SerializationContext createContext() throws IOException, DescriptorParserException {
      return createContext(new ConfigurationBuilder().build());
   }
View Full Code Here

      user.setAddresses(addresses);
      return user;
   }

   private void readWithProtoStream(byte[] bytes, long[] result) throws IOException, DescriptorParserException {
      Configuration cfg = new ConfigurationBuilder().setLogOutOfSequenceReads(false).build();
      SerializationContext ctx = createContext(cfg);
      ByteArrayInputStream bais = new ByteArrayInputStream(bytes);

      long tStart = System.nanoTime();
      for (int i = 0; i < NUM_INNER_LOOPS; i++) {
View Full Code Here

      result[0] = System.nanoTime() - tStart;
      log.infof("Java serialization read duration    = %d ns", result[0]);
   }

   private byte[] writeWithProtoStream(User user, long[] result) throws IOException, DescriptorParserException {
      Configuration cfg = new ConfigurationBuilder().setLogOutOfSequenceWrites(false).build();
      SerializationContext ctx = createContext(cfg);
      ByteArrayOutputStream out = new ByteArrayOutputStream(1024);

      long tStart = System.nanoTime();
      for (int i = 0; i < NUM_INNER_LOOPS; i++) {
View Full Code Here

      user.setAddresses(addresses);
      return user;
   }

   private void readWithProtoStream(byte[] bytes, long[] result) throws IOException, Descriptors.DescriptorValidationException {
      Configuration cfg = new ConfigurationBuilder().setLogOutOfSequenceReads(false).build();
      SerializationContext ctx = createContext(cfg);
      ByteArrayInputStream bais = new ByteArrayInputStream(bytes);

      long tStart = System.nanoTime();
      for (int i = 0; i < NUM_INNER_LOOPS; i++) {
View Full Code Here

      result[0] = System.nanoTime() - tStart;
      log.infof("Java serialization read duration    = %d ns", result[0]);
   }

   private byte[] writeWithProtoStream(User user, long[] result) throws IOException, Descriptors.DescriptorValidationException {
      Configuration cfg = new ConfigurationBuilder().setLogOutOfSequenceWrites(false).build();
      SerializationContext ctx = createContext(cfg);
      ByteArrayOutputStream out = new ByteArrayOutputStream(1024);

      long tStart = System.nanoTime();
      for (int i = 0; i < NUM_INNER_LOOPS; i++) {
View Full Code Here

TOP

Related Classes of org.infinispan.protostream.ConfigurationBuilder

Copyright © 2018 www.massapicom. 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.