Package org.infinispan.query.remote

Examples of org.infinispan.query.remote.ProtobufMetadataManager


      //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


      //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

        final String cacheContainerName = address.getElement(address.size() - 1).getValue();
        final ServiceController<?> controller = context.getServiceRegistry(false).getService(
              EmbeddedCacheManagerService.getServiceName(cacheContainerName));

        EmbeddedCacheManager cacheManager = (EmbeddedCacheManager) controller.getValue();
        ProtobufMetadataManager protoManager = cacheManager.getGlobalComponentRegistry().getComponent(ProtobufMetadataManager.class);
        if (protoManager != null) {
           try {
              List<ModelNode> descriptorsNodes = newValue.asList();
              String[] nameArray = new String[descriptorsNodes.size()];
              String[] contentArray = new String[descriptorsNodes.size()];
              int i = 0;
              for (ModelNode modelNode : descriptorsNodes) {
                 String urlString = modelNode.asString();
                 nameArray[i] = extractFile(urlString);
                 contentArray[i] = Util.read(new URL(urlString).openStream());
                 i++;  
              }
              protoManager.registerProtofiles(nameArray, contentArray);
           } catch (Exception e) {
              throw new OperationFailedException(new ModelNode().set(MESSAGES.failedToInvokeOperation(e.getLocalizedMessage())));
           }
        }
        context.stepCompleted();
View Full Code Here

        final String cacheContainerName = address.getElement(address.size() - 1).getValue();
        final ServiceController<?> controller = context.getServiceRegistry(false).getService(
              EmbeddedCacheManagerService.getServiceName(cacheContainerName));

        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

      createHotRodServers(2, defaultConfiguration);

      //initialize server-side serialization context
      for (EmbeddedCacheManager cm : cacheManagers) {
         cm.defineConfiguration("queryableCache", builder.build());
         ProtobufMetadataManager component = cm.getGlobalComponentRegistry().getComponent(ProtobufMetadataManager.class);
         component.registerProtofiles("/sample_bank_account/bank.proto", "/infinispan/indexing.proto", "/google/protobuf/descriptor.proto");
      }

      //initialize client-side serialization context
      for (RemoteCacheManager rcm : clients) {
         MarshallerRegistration.registerMarshallers(ProtoStreamMarshaller.getSerializationContext(rcm));
View Full Code Here

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

      //initialize server-side serialization context
      ProtobufMetadataManager protobufMetadataManager = cacheManager.getGlobalComponentRegistry().getComponent(ProtobufMetadataManager.class);
      protobufMetadataManager.registerProtofiles("/infinispan/indexing.proto", "/sample_bank_account/bank.proto", "/google/protobuf/descriptor.proto");
      protobufMetadataManager.registerMarshaller(new EmbeddedAccountMarshaller());

      return cacheManager;
   }
View Full Code Here

   }

   @BeforeClass(alwaysRun = true)
   protected void populateCache() throws Exception {
      //initialize server-side serialization context
      ProtobufMetadataManager protobufMetadataManager = manager(0).getGlobalComponentRegistry().getComponent(ProtobufMetadataManager.class);
      protobufMetadataManager.registerProtofiles("/sample_bank_account/bank.proto", "/infinispan/indexing.proto", "/google/protobuf/descriptor.proto");

      //initialize client-side serialization context
      for (RemoteCacheManager rcm : clients) {
         MarshallerRegistration.registerMarshallers(ProtoStreamMarshaller.getSerializationContext(rcm));
      }
View Full Code Here

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

      //initialize server-side serialization context
      ProtobufMetadataManager protobufMetadataManager = cacheManager.getGlobalComponentRegistry().getComponent(ProtobufMetadataManager.class);
      protobufMetadataManager.registerProtofiles("/infinispan/indexing.proto", "/sample_bank_account/bank.proto", "/google/protobuf/descriptor.proto");
      protobufMetadataManager.registerMarshaller(new EmbeddedAccountMarshaller());

      return cacheManager;
   }
View Full Code Here

      clientBuilder.marshaller(new ProtoStreamMarshaller());
      remoteCacheManager = new RemoteCacheManager(clientBuilder.build());
      remoteCache = remoteCacheManager.getCache();

      //initialize server-side serialization context
      ProtobufMetadataManager protobufMetadataManager = manager(0).getGlobalComponentRegistry().getComponent(ProtobufMetadataManager.class);
      protobufMetadataManager.registerProtofiles("/sample_bank_account/bank.proto", "/infinispan/indexing.proto", "/google/protobuf/descriptor.proto");

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

      clientBuilder.marshaller(new ProtoStreamMarshaller());
      remoteCacheManager = new RemoteCacheManager(clientBuilder.build());
      remoteCache = remoteCacheManager.getCache(TEST_CACHE_NAME);

      //initialize server-side serialization context
      ProtobufMetadataManager protobufMetadataManager = manager(0).getGlobalComponentRegistry().getComponent(ProtobufMetadataManager.class);
      protobufMetadataManager.registerProtofiles("/infinispan/indexing.proto", "/sample_bank_account/bank.proto", "/google/protobuf/descriptor.proto");

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

TOP

Related Classes of org.infinispan.query.remote.ProtobufMetadataManager

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.