Search in sources :

Example 1 with GenderMarshaller

use of org.infinispan.protostream.sampledomain.marshallers.GenderMarshaller in project camel by apache.

the class InfinispanContinuousQueryIT method doPreSetup.

@Override
protected void doPreSetup() throws IOException {
    ConfigurationBuilder builder = new ConfigurationBuilder().addServer().host("localhost").port(11222).marshaller(new ProtoStreamMarshaller());
    manager = new RemoteCacheManager(builder.build());
    RemoteCache<String, String> metadataCache = manager.getCache(ProtobufMetadataManagerConstants.PROTOBUF_METADATA_CACHE_NAME);
    metadataCache.put("sample_bank_account/bank.proto", Util.read(InfinispanContinuousQueryIT.class.getResourceAsStream("/sample_bank_account/bank.proto")));
    MarshallerRegistration.registerMarshallers(ProtoStreamMarshaller.getSerializationContext(manager));
    SerializationContext serCtx = ProtoStreamMarshaller.getSerializationContext(manager);
    serCtx.registerProtoFiles(FileDescriptorSource.fromResources("/sample_bank_account/bank.proto"));
    serCtx.registerMarshaller(new UserMarshaller());
    serCtx.registerMarshaller(new GenderMarshaller());
    // pre-load data
    cache = manager.getCache("remote_query");
    cache.clear();
}
Also used : SerializationContext(org.infinispan.protostream.SerializationContext) ConfigurationBuilder(org.infinispan.client.hotrod.configuration.ConfigurationBuilder) RemoteCacheManager(org.infinispan.client.hotrod.RemoteCacheManager) UserMarshaller(org.infinispan.protostream.sampledomain.marshallers.UserMarshaller) ProtoStreamMarshaller(org.infinispan.client.hotrod.marshall.ProtoStreamMarshaller) GenderMarshaller(org.infinispan.protostream.sampledomain.marshallers.GenderMarshaller)

Example 2 with GenderMarshaller

use of org.infinispan.protostream.sampledomain.marshallers.GenderMarshaller in project camel by apache.

the class InfinispanRemoteQueryProducerIT method doPreSetup.

@Override
protected void doPreSetup() throws IOException {
    ConfigurationBuilder builder = new ConfigurationBuilder().addServer().host("localhost").port(11222).marshaller(new ProtoStreamMarshaller());
    manager = new RemoteCacheManager(builder.build());
    RemoteCache<String, String> metadataCache = manager.getCache(ProtobufMetadataManagerConstants.PROTOBUF_METADATA_CACHE_NAME);
    metadataCache.put("sample_bank_account/bank.proto", Util.read(InfinispanRemoteQueryProducerIT.class.getResourceAsStream("/sample_bank_account/bank.proto")));
    MarshallerRegistration.registerMarshallers(ProtoStreamMarshaller.getSerializationContext(manager));
    SerializationContext serCtx = ProtoStreamMarshaller.getSerializationContext(manager);
    serCtx.registerProtoFiles(FileDescriptorSource.fromResources("/sample_bank_account/bank.proto"));
    serCtx.registerMarshaller(new UserMarshaller());
    serCtx.registerMarshaller(new GenderMarshaller());
}
Also used : SerializationContext(org.infinispan.protostream.SerializationContext) ConfigurationBuilder(org.infinispan.client.hotrod.configuration.ConfigurationBuilder) RemoteCacheManager(org.infinispan.client.hotrod.RemoteCacheManager) UserMarshaller(org.infinispan.protostream.sampledomain.marshallers.UserMarshaller) ProtoStreamMarshaller(org.infinispan.client.hotrod.marshall.ProtoStreamMarshaller) GenderMarshaller(org.infinispan.protostream.sampledomain.marshallers.GenderMarshaller)

Aggregations

RemoteCacheManager (org.infinispan.client.hotrod.RemoteCacheManager)2 ConfigurationBuilder (org.infinispan.client.hotrod.configuration.ConfigurationBuilder)2 ProtoStreamMarshaller (org.infinispan.client.hotrod.marshall.ProtoStreamMarshaller)2 SerializationContext (org.infinispan.protostream.SerializationContext)2 GenderMarshaller (org.infinispan.protostream.sampledomain.marshallers.GenderMarshaller)2 UserMarshaller (org.infinispan.protostream.sampledomain.marshallers.UserMarshaller)2