/** * {@inheritDoc} */ @Override public Endpoint endpoint() { return state().endpoint(); } }
/** * Use for control of how tracing state propagates across threads. */ public Builder(ServerClientAndLocalSpanState state) { this.state = Util.checkNotNull(state, "state must be specified."); this.localEndpoint = state.endpoint(); // the legacy span state doesn't support nested spans per (#166). Only permit nesting on the span // state that has instructions on how to use it properly this.allowNestedLocalSpans = state instanceof InheritableServerClientAndLocalSpanState; }
@Override public Endpoint endpoint() { return state().endpoint(); } }
/** * {@inheritDoc} */ @Override public Endpoint endpoint() { return state().endpoint(); } }
@Override public Endpoint endpoint() { return state().endpoint(); } }
public final Builder state(ServerClientAndLocalSpanState state) { this.currentLocalSpan = new LocalSpanThreadBinder(state); this.currentServerSpan = new ServerSpanThreadBinder(state); this.currentSpan = new ClientSpanThreadBinder(state); this.localEndpoint = state.endpoint(); return this; }
/** * Builder. * <p> * When using this builder constructor we will try to 'guess' ip address by using java.net.* utility classes. * This might be convenient but not necessary what you want. * It is preferred to use constructor that takes ip, port and service name instead. * </p> * * @param serviceName Name of the local service being traced. Should be lowercase and not <code>null</code> or empty. */ public Builder(String serviceName) { int ipv4 = 127 << 24 | 1; try { ipv4 = toInt(getLocalHostLANAddress()); } catch (UnknownHostException e) { logger.log(Level.WARNING, "Unable to get Inet address", e); } state = new ThreadLocalServerClientAndLocalSpanState(ipv4, 0, serviceName); localEndpoint = state.endpoint(); }