com.guicedee.guicedservlets.websockets.WebSocketsConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of guiced-websockets Show documentation
Show all versions of guiced-websockets Show documentation
Provides a WebSocket implementation using JSR356 for Guiced JPMS
package com.guicedee.guicedservlets.websockets;
import com.guicedee.guicedinjection.GuiceContext;
import com.guicedee.guicedinjection.interfaces.IGuicePreStartup;
import com.guicedee.guicedservlets.websockets.services.IWebSocketPreConfiguration;
import java.util.ServiceLoader;
import java.util.Set;
import java.util.TreeSet;
public class WebSocketsConfiguration
implements IGuicePreStartup
{
@Override
public void onStartup()
{
Set loader = GuiceContext.instance()
.getLoader(IWebSocketPreConfiguration.class, true, ServiceLoader.load(IWebSocketPreConfiguration.class));
Set sortedSet = new TreeSet<>(loader);
sortedSet.removeIf(preConfiguration -> !preConfiguration.enabled());
sortedSet.forEach(IWebSocketPreConfiguration::configure);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy