io.vertx.core.net.impl.ServerID Java Examples

The following examples show how to use io.vertx.core.net.impl.ServerID. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AtomixClusterManager.java    From atomix-vertx with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a new Vert.x compatible serializer.
 */
private Serializer createSerializer() {
  return Serializer.using(Namespace.builder()
      .setRegistrationRequired(false)
      .register(Namespaces.BASIC)
      .register(ServerID.class)
      .register(new ClusterSerializableSerializer<>(), ClusterSerializable.class)
      .build());
}
 
Example #2
Source File: ClusteredEventBusSendRemoteInterceptor.java    From skywalking with Apache License 2.0 5 votes vote down vote up
@Override
@SuppressWarnings("rawtypes")
public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
    MethodInterceptResult result) throws Throwable {
    ContextManager.getRuntimeContext().remove(VertxContext.STOP_SPAN_NECESSARY + "." + getClass().getName());

    ClusteredMessage message = (ClusteredMessage) allArguments[1];
    if (VertxContext.hasContext(message.address())) {
        VertxContext context = VertxContext.popContext(message.address());
        context.getSpan().asyncFinish();
    } else {
        ServerID sender = (ServerID) allArguments[0];
        ContextCarrier contextCarrier = new ContextCarrier();
        AbstractSpan span = ContextManager.createExitSpan(message.address(), contextCarrier, sender.toString());
        span.setComponent(ComponentsDefine.VERTX);
        SpanLayer.asRPCFramework(span);

        CarrierItem next = contextCarrier.items();
        while (next.hasNext()) {
            next = next.next();
            message.headers().add(next.getHeadKey(), next.getHeadValue());
        }

        if (message.replyAddress() != null) {
            VertxContext.pushContext(message.replyAddress(), new VertxContext(ContextManager.capture(), span.prepareForAsync()));
        }
        ContextManager.getRuntimeContext().put(VertxContext.STOP_SPAN_NECESSARY + "." + getClass().getName(), true);
    }
}
 
Example #3
Source File: HazelcastServerID.java    From vertx-hazelcast with Apache License 2.0 5 votes vote down vote up
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;
  }
}
 
Example #4
Source File: VertxSubstitutions.java    From quarkus with Apache License 2.0 4 votes vote down vote up
@Substitute
private void sendRemote(ServerID theServerID, MessageImpl message) {
    throw new RuntimeException("Not Implemented");
}
 
Example #5
Source File: HazelcastServerID.java    From vertx-hazelcast with Apache License 2.0 4 votes vote down vote up
public HazelcastServerID(ServerID serverID) {
  super(serverID.port, serverID.host);
}