• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java ServerID类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中io.vertx.core.net.impl.ServerID的典型用法代码示例。如果您正苦于以下问题:Java ServerID类的具体用法?Java ServerID怎么用?Java ServerID使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

ServerID类属于io.vertx.core.net.impl包,在下文中一共展示了ServerID类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: toCachedObject

点赞 2

import io.vertx.core.net.impl.ServerID; //导入依赖的package包/类
public static <T> Object toCachedObject(T t) {
  if (t instanceof ServerID) {
    return new InfinispanServerID((ServerID) t);
  }
  if (t instanceof ClusterNodeInfo) {
    return new InfinispanClusterNodeInfo((ClusterNodeInfo) t);
  }
  if (t instanceof ClusterSerializable) {
    return new InfinispanClusterSerializable((ClusterSerializable) t);
  }
  return t;
}
 

开发者ID:vert-x3,
项目名称:vertx-infinispan,
代码行数:13,
代码来源:DataConverter.java

示例2: createSerializer

点赞 2

import io.vertx.core.net.impl.ServerID; //导入依赖的package包/类
/**
 * Creates a new Vert.x compatible serializer.
 */
private Serializer createSerializer() {
  return Serializer.using(KryoNamespace.builder()
      .setRegistrationRequired(false)
      .register(KryoNamespaces.BASIC)
      .register(ServerID.class)
      .register(new ClusterSerializableSerializer<>(), ClusterSerializable.class)
      .build());
}
 

开发者ID:atomix,
项目名称:atomix-vertx,
代码行数:12,
代码来源:AtomixClusterManager.java

示例3: convertServerID

点赞 2

import io.vertx.core.net.impl.ServerID; //导入依赖的package包/类
public static <V> V convertServerID(V val) {
  if (val.getClass() == ServerID.class) {
    ServerID sid = (ServerID)val;
    HazelcastServerID hsid = new HazelcastServerID(sid);
    return (V)hsid;
  } else {
    return val;
  }
}
 

开发者ID:vert-x3,
项目名称:vertx-hazelcast,
代码行数:10,
代码来源:HazelcastServerID.java

示例4: shouldNotAddToMapCacheIfKeyDoesntAlreadyExist

点赞 2

import io.vertx.core.net.impl.ServerID; //导入依赖的package包/类
@Test
public void shouldNotAddToMapCacheIfKeyDoesntAlreadyExist() throws Exception {
  String nonexistentKey = "non-existent-key." + UUID.randomUUID();

  map.get(nonexistentKey, ar -> {
    if (ar.succeeded()) {
      try {
        ChoosableIterable<ServerID> s = ar.result();
        Map<String, ChoosableIterable<ServerID>> cache = getCacheFromMap();

        // System.err.println("CACHE CONTENTS: " + cache);

        // check result
        assertNotNull(s);
        assertTrue(s.isEmpty());

        // check cache
        assertNotNull(cache);
        assertFalse(
            "Map cache should not contain key " + nonexistentKey,
            cache.containsKey(nonexistentKey));

      } catch (Exception e) {
        fail(e.toString());
      } finally {
        testComplete();
      }
    } else {
      fail(ar.cause().toString());
    }
  });

  await();
}
 

开发者ID:vert-x3,
项目名称:vertx-hazelcast,
代码行数:35,
代码来源:HazelcastAsyncMultiMapTest.java

示例5: readObject

点赞 2

import io.vertx.core.net.impl.ServerID; //导入依赖的package包/类
@Override
public InfinispanClusterNodeInfo readObject(ObjectInput input) throws IOException, ClassNotFoundException {
  ClusterNodeInfo clusterNodeInfo = new ClusterNodeInfo(input.readUTF(), new ServerID(input.readInt(), input.readUTF()));
  return new InfinispanClusterNodeInfo(clusterNodeInfo);
}
 

开发者ID:vert-x3,
项目名称:vertx-infinispan,
代码行数:6,
代码来源:InfinispanClusterNodeInfo.java

示例6: InfinispanServerID

点赞 2

import io.vertx.core.net.impl.ServerID; //导入依赖的package包/类
public InfinispanServerID(ServerID serverID) {
  Objects.requireNonNull(serverID);
  this.serverID = serverID;
}
 

开发者ID:vert-x3,
项目名称:vertx-infinispan,
代码行数:5,
代码来源:InfinispanServerID.java

示例7: getServerID

点赞 2

import io.vertx.core.net.impl.ServerID; //导入依赖的package包/类
public ServerID getServerID() {
  return serverID;
}
 

开发者ID:vert-x3,
项目名称:vertx-infinispan,
代码行数:4,
代码来源:InfinispanServerID.java

示例8: readObject

点赞 2

import io.vertx.core.net.impl.ServerID; //导入依赖的package包/类
@Override
public InfinispanServerID readObject(ObjectInput input) throws IOException, ClassNotFoundException {
  ServerID serverID = new ServerID(input.readInt(), input.readUTF());
  return new InfinispanServerID(serverID);
}
 

开发者ID:vert-x3,
项目名称:vertx-infinispan,
代码行数:6,
代码来源:InfinispanServerID.java

示例9: HazelcastServerID

点赞 2

import io.vertx.core.net.impl.ServerID; //导入依赖的package包/类
public HazelcastServerID(ServerID serverID) {
  super(serverID.port, serverID.host);
}
 

开发者ID:vert-x3,
项目名称:vertx-hazelcast,
代码行数:4,
代码来源:HazelcastServerID.java

示例10: readData

点赞 2

import io.vertx.core.net.impl.ServerID; //导入依赖的package包/类
@Override
public void readData(ObjectDataInput dataInput) throws IOException {
  nodeId = dataInput.readUTF();
  serverID = new ServerID(dataInput.readInt(), dataInput.readUTF());
}
 

开发者ID:vert-x3,
项目名称:vertx-hazelcast,
代码行数:6,
代码来源:HazelcastClusterNodeInfo.java

示例11: getCacheFromMap

点赞 2

import io.vertx.core.net.impl.ServerID; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private Map<String, ChoosableIterable<ServerID>> getCacheFromMap() throws Exception {
  Field field = map.getClass().getDeclaredField("cache");
  field.setAccessible(true);
  return (Map<String, ChoosableIterable<ServerID>>) field.get(map);
}
 

开发者ID:vert-x3,
项目名称:vertx-hazelcast,
代码行数:7,
代码来源:HazelcastAsyncMultiMapTest.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)