Package org.infinispan.client.hotrod

Examples of org.infinispan.client.hotrod.RemoteCacheManager


    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();
      cache.put(entity.key(), entity.value());
      System.out.println(i);
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 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");
            t.addPlayer("Kobe Bryant");
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

  public static void main(String[] args) throws InterruptedException {

    Properties props = new Properties();
    props.put("infinispan.client.hotrod.server_list", "127.0.0.1:11222");
    RemoteCacheManager cacheManager = new RemoteCacheManager(props);
    RemoteCache<Object, Object> cache = cacheManager.getCache();
   
    for(int i = 0 ; i < 1000000 ; i ++) {
      cache.put("key---" + i, new User(i, "Kylin Soong", "SoftWare Engineer"));
    }
   
View Full Code Here

  public static void main(String[] args) {

    Properties props = new Properties();
    props.put("infinispan.client.hotrod.server_list", "127.0.0.1:11222");
    RemoteCacheManager cacheManager = new RemoteCacheManager(props);
    RemoteCache<Object, Object> cache = cacheManager.getCache();

    System.out.println(cache);

    cache.put("key", new User(1, "Kylin Soong", "IT"));
View Full Code Here

    private BasicCacheContainer manager;

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

      hotRodServer = TestHelper.startHotRodServer(cacheManager);

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

      remoteCache = remoteCacheManager.getCache(TEST_CACHE_NAME);

      ObjectName objName = new ObjectName(JMX_DOMAIN + ":type=RemoteQuery,name="
                                                + ObjectName.quote("DefaultCacheManager")
View Full Code Here

      hotRodServer = TestHelper.startHotRodServer(cacheManager);

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

      remoteCache = remoteCacheManager.getCache(TEST_CACHE_NAME);

      ObjectName objName = new ObjectName(JMX_DOMAIN + ":type=RemoteQuery,name="
                                                + ObjectName.quote("DefaultCacheManager")
View Full Code Here

      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

TOP

Related Classes of org.infinispan.client.hotrod.RemoteCacheManager

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.