use of org.eclipse.jetty.util.component.ContainerLifeCycle in project jetty.project by eclipse.
the class SslClientConnectionFactory method customize.
@Override
public Connection customize(Connection connection, Map<String, Object> context) {
if (connection instanceof SslConnection) {
SslConnection sslConnection = (SslConnection) connection;
sslConnection.setRenegotiationAllowed(sslContextFactory.isRenegotiationAllowed());
ContainerLifeCycle connector = (ContainerLifeCycle) context.get(ClientConnectionFactory.CONNECTOR_CONTEXT_KEY);
connector.getBeans(SslHandshakeListener.class).forEach(sslConnection::addHandshakeListener);
}
return ClientConnectionFactory.super.customize(connection, context);
}
use of org.eclipse.jetty.util.component.ContainerLifeCycle in project jetty.project by eclipse.
the class WebSocketCdiListener method lifeCycleStarting.
@Override
public void lifeCycleStarting(LifeCycle event) {
if (event instanceof WebSocketContainerScope) {
if (LOG.isDebugEnabled()) {
LOG.debug("started websocket container [{}]", event);
}
ContainerListener listener = new ContainerListener((WebSocketContainerScope) event);
if (event instanceof ContainerLifeCycle) {
ContainerLifeCycle container = (ContainerLifeCycle) event;
container.addLifeCycleListener(listener);
container.addEventListener(listener);
} else {
throw new RuntimeException("Unable to setup CDI against non-container: " + event.getClass().getName());
}
}
}
Aggregations