Java Code Examples for io.undertow.Undertow#ListenerInfo

The following examples show how to use io.undertow.Undertow#ListenerInfo . 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: JmxReporterService.java    From galeb with Apache License 2.0 5 votes vote down vote up
private long extractDelta(final AtomicLong last, final ToLongFunction<Undertow.ListenerInfo> longFunction) {
    long start = System.nanoTime();
    double localLast = last.get() * 1.0;
    double current = undertow.getListenerInfo().stream().mapToLong(longFunction).sum() * 1.0;
    long end = System.nanoTime();
    last.set((long) current);
    return Math.round((current * ((double) end / (double) start)) - localLast);
}
 
Example 2
Source File: UndertowServer.java    From digdag with Apache License 2.0 5 votes vote down vote up
private static OpenListener httpListenerOf(Undertow.ListenerInfo listenerInfo)
{
    try {
        Field listenerField = Undertow.ListenerInfo.class.getDeclaredField("openListener");
        listenerField.setAccessible(true);
        return (OpenListener) listenerField.get(listenerInfo);
    }
    catch (NoSuchFieldException | IllegalAccessException | ClassCastException e) {
        throw new AssertionError("Failed to get local listen address", e);
    }
}
 
Example 3
Source File: UndertowTestServer.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Override
public void start() throws Exception {
	this.server.start();
	Undertow.ListenerInfo info = this.server.getListenerInfo().get(0);
	this.port = ((InetSocketAddress) info.getAddress()).getPort();
}
 
Example 4
Source File: UndertowHttpServer.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Override
protected void startInternal() {
	this.server.start();
	Undertow.ListenerInfo info = this.server.getListenerInfo().get(0);
	setPort(((InetSocketAddress) info.getAddress()).getPort());
}
 
Example 5
Source File: UndertowTestServer.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Override
public void start() throws Exception {
	this.server.start();
	Undertow.ListenerInfo info = this.server.getListenerInfo().get(0);
	this.port = ((InetSocketAddress) info.getAddress()).getPort();
}
 
Example 6
Source File: UndertowHttpServer.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Override
protected void startInternal() {
	this.server.start();
	Undertow.ListenerInfo info = this.server.getListenerInfo().get(0);
	setPort(((InetSocketAddress) info.getAddress()).getPort());
}