Examples of registerProtofile()


Examples of org.infinispan.protostream.SerializationContext.registerProtofile()

      assertEquals("1234", fromCache.getAddresses().get(0).getPostCode());
   }

   private SerializationContext initSerializationContext() throws IOException, Descriptors.DescriptorValidationException {
      SerializationContext ctx = ProtostreamMarshaller.getSerializationContext();
      ctx.registerProtofile("/bank.protobin");
      ctx.registerMarshaller(User.class, new UserMarshaller());
      ctx.registerEnumEncoder(User.Gender.class, new GenderEncoder());
      ctx.registerMarshaller(Address.class, new AddressMarshaller());
      ctx.registerMarshaller(Account.class, new AccountMarshaller());
      ctx.registerMarshaller(Transaction.class, new TransactionMarshaller());
View Full Code Here

Examples of org.infinispan.protostream.impl.SerializationContextImpl.registerProtofile()

   public static SerializationContext newSerializationContext(Configuration configuration) {
      SerializationContextImpl serializationContext = new SerializationContextImpl(configuration);

      try {
         serializationContext.registerProtofile(WRAPPING_DEFINITIONS_RES);
      } catch (IOException e) {
         throw new RuntimeException("Failed to initialize serialization context", e);
      } catch (Descriptors.DescriptorValidationException e) {
         throw new RuntimeException("Failed to initialize serialization context", e);
      }
View Full Code Here

Examples of org.infinispan.query.remote.ProtobufMetadataManager.registerProtofile()

      //initialize client-side serialization context
      MarshallerRegistration.registerMarshallers(ProtoStreamMarshaller.getSerializationContext(remoteCacheManager));

      //initialize server-side serialization context
      ProtobufMetadataManager protobufMetadataManager = cacheManager.getGlobalComponentRegistry().getComponent(ProtobufMetadataManager.class);
      protobufMetadataManager.registerProtofile("/bank.protobin");
      protobufMetadataManager.registerMarshaller(EmbeddedAccount.class, new EmbeddedAccountMarshaller());

      return cacheManager;
   }
View Full Code Here

Examples of org.infinispan.query.remote.ProtobufMetadataManager.registerProtofile()

      //initialize client-side serialization context
      MarshallerRegistration.registerMarshallers(ProtoStreamMarshaller.getSerializationContext(remoteCacheManager));

      //initialize server-side serialization context
      ProtobufMetadataManager protobufMetadataManager = cacheManager.getGlobalComponentRegistry().getComponent(ProtobufMetadataManager.class);
      protobufMetadataManager.registerProtofile("/sample_bank_account/bank.protobin");
      protobufMetadataManager.registerMarshaller(EmbeddedAccount.class, new EmbeddedAccountMarshaller());

      return cacheManager;
   }
View Full Code Here

Examples of org.infinispan.query.remote.ProtobufMetadataManager.registerProtofile()

        EmbeddedCacheManager cacheManager = (EmbeddedCacheManager) controller.getValue();
        ProtobufMetadataManager protoManager = cacheManager.getGlobalComponentRegistry().getComponent(ProtobufMetadataManager.class);
        if (protoManager != null) {
           try {
              URL url = new URL(urlString);
              protoManager.registerProtofile(url.openStream());
           } catch (Exception e) {
              throw new OperationFailedException(new ModelNode().set(MESSAGES.failedToInvokeOperation(e.getLocalizedMessage())));
           }
        }
        context.stepCompleted();
View Full Code Here

Examples of org.infinispan.query.remote.ProtobufMetadataManagerMBean.registerProtofile()

                                                + ",component=" + ProtobufMetadataManager.OBJECT_NAME);

      byte[] descriptor = readClasspathResource("/bank.protobin");
      MBeanServer mBeanServer = PerThreadMBeanServerLookup.getThreadMBeanServer();
      ProtobufMetadataManagerMBean protobufMetadataManagerMBean = JMX.newMBeanProxy(mBeanServer, objName, ProtobufMetadataManagerMBean.class);
      protobufMetadataManagerMBean.registerProtofile(descriptor);

      //initialize client-side serialization context
      MarshallerRegistration.registerMarshallers(ProtoStreamMarshaller.getSerializationContext(remoteCacheManager));
      server = PerThreadMBeanServerLookup.getThreadMBeanServer();
View Full Code Here

Examples of org.infinispan.query.remote.ProtobufMetadataManagerMBean.registerProtofile()

                                                + ",component=" + ProtobufMetadataManager.OBJECT_NAME);

      byte[] descriptor = readClasspathResource("/sample_bank_account/bank.protobin");
      MBeanServer mBeanServer = PerThreadMBeanServerLookup.getThreadMBeanServer();
      ProtobufMetadataManagerMBean protobufMetadataManagerMBean = JMX.newMBeanProxy(mBeanServer, objName, ProtobufMetadataManagerMBean.class);
      protobufMetadataManagerMBean.registerProtofile(descriptor);

      //initialize client-side serialization context
      MarshallerRegistration.registerMarshallers(ProtoStreamMarshaller.getSerializationContext(remoteCacheManager));
      server = PerThreadMBeanServerLookup.getThreadMBeanServer();
View Full Code Here
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.