Package org.infinispan.client.hotrod.configuration

Examples of org.infinispan.client.hotrod.configuration.ConfigurationBuilder


    private static final String PROPERTIES_FILE = "jdg.properties";
    private static final String CACHE_NAME = "teams";

  public static void main(String[] args) {
   
    Configuration configuration = new ConfigurationBuilder().addServers(jdgProperty(JDG_HOST) + ":" + jdgProperty(HOTROD_PORT)).build();
    RemoteCacheManager cacheManager = new RemoteCacheManager(configuration);
    RemoteCache<String, Object> cache = cacheManager.getCache(CACHE_NAME);
   
    for(int i = 1 ; ; i++) {
      TrafficTestEntity entity = new TrafficTestEntity();
View Full Code Here


    private RemoteCacheManager manager;

    public RemoteCacheManager getCacheContainer() {
        if (manager == null) {
          Configuration configuration = new ConfigurationBuilder().addServers(jdgProperty(DATAGRID_HOST) + ":" + jdgProperty(HOTROD_PORT)).build();
            manager = new RemoteCacheManager(configuration, true);
            log.info("=== Using RemoteCacheManager (Hot Rod) ===");
        }
        return manager;
    }
View Full Code Here

    private RemoteCacheManager cacheManager;
    private RemoteCache<String, Object> cache;

    public FootballManager(Console con) {
        this.con = con;
        Configuration configuration = new ConfigurationBuilder().addServers(jdgProperty(JDG_HOST) + ":" + jdgProperty(HOTROD_PORT)).build();
        cacheManager = new RemoteCacheManager(configuration);
        cache = cacheManager.getCache("teams");
        if(!cache.containsKey(teamsKey)) {
            List<String> teams = new ArrayList<String>();
            Team t = new Team("Lakers");
View Full Code Here

 
  RemoteCache<Object, Object> cache;

  @Before
  public void setup() {
    Configuration configuration = new ConfigurationBuilder().addServers("127.0.0.1:11222").build();
    RemoteCacheManager manager = new RemoteCacheManager(configuration);
    cache = manager.getCache();
  }
View Full Code Here

      cacheManager = TestCacheManagerFactory.createCacheManager(hotRodCacheConfiguration());
      cache = cacheManager.getCache();

      hotRodServer = TestHelper.startHotRodServer(cacheManager);

      ConfigurationBuilder clientBuilder = new ConfigurationBuilder();
      clientBuilder.addServer().host("127.0.0.1").port(hotRodServer.getPort());
      clientBuilder.marshaller(new ProtoStreamMarshaller());
      remoteCacheManager = new RemoteCacheManager(clientBuilder.build());

      remoteCache = remoteCacheManager.getCache();

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

      }
      return builder.toString();
   }

   public static RemoteCacheManager getRemoteCacheManager(HotRodServer server) {
      ConfigurationBuilder builder = new ConfigurationBuilder();
      builder.addServer()
         .host(server.getHost())
         .port(server.getPort());
      return new RemoteCacheManager(builder.build());

   }
View Full Code Here

      cacheManager = TestCacheManagerFactory.createCacheManager(builder);
      cache = cacheManager.getCache();

      hotRodServer = TestHelper.startHotRodServer(cacheManager);

      ConfigurationBuilder clientBuilder = new ConfigurationBuilder();
      clientBuilder.addServer().host("127.0.0.1").port(hotRodServer.getPort());
      clientBuilder.marshaller(new ProtoStreamMarshaller());
      remoteCacheManager = new RemoteCacheManager(clientBuilder.build());

      remoteCache = remoteCacheManager.getCache();

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

    * @param props      other properties
    * @param start      whether or not to start the manager on return from the constructor.
    */
   @Deprecated
   public RemoteCacheManager(Marshaller marshaller, Properties props, boolean start) {
      this(new ConfigurationBuilder().classLoader(Thread.currentThread().getContextClassLoader()).withProperties(props).marshaller(marshaller.getClass()).build(), start);
   }
View Full Code Here

    * @param props      other properties
    * @param start      whether or not to start the manager on return from the constructor.
    */
   @Deprecated
   public RemoteCacheManager(Marshaller marshaller, Properties props, boolean start, ClassLoader classLoader, ExecutorFactory asyncExecutorFactory) {
      this(new ConfigurationBuilder().classLoader(classLoader).withProperties(props).marshaller(marshaller).asyncExecutorFactory().factory(asyncExecutorFactory).build(), start);
   }
View Full Code Here

   /**
    * Same as {@link #RemoteCacheManager(Marshaller, java.util.Properties, boolean)} with start = true.
    */
   @Deprecated
   public RemoteCacheManager(Marshaller marshaller, Properties props, ExecutorFactory asyncExecutorFactory) {
      this(new ConfigurationBuilder().withProperties(props).marshaller(marshaller).asyncExecutorFactory().factory(asyncExecutorFactory).build());
   }
View Full Code Here

TOP

Related Classes of org.infinispan.client.hotrod.configuration.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.