use of org.eclipse.jetty.util.component.ContainerLifeCycle in project dropwizard by dropwizard.
the class LifecycleEnvironmentTest method managesLifeCycleObjects.
@Test
public void managesLifeCycleObjects() throws Exception {
final LifeCycle lifeCycle = mock(LifeCycle.class);
environment.manage(lifeCycle);
final ContainerLifeCycle container = new ContainerLifeCycle();
environment.attach(container);
assertThat(container.getBeans()).contains(lifeCycle);
}
use of org.eclipse.jetty.util.component.ContainerLifeCycle in project jetty.project by eclipse.
the class ALPNClientConnectionFactory method newConnection.
@Override
public Connection newConnection(EndPoint endPoint, Map<String, Object> context) throws IOException {
SSLEngine sslEngine = (SSLEngine) context.get(SslClientConnectionFactory.SSL_ENGINE_CONTEXT_KEY);
getALPNProcessor().configure(sslEngine, protocols);
ContainerLifeCycle connector = (ContainerLifeCycle) context.get(ClientConnectionFactory.CONNECTOR_CONTEXT_KEY);
// Method addBean() has set semantic, so the listener is added only once.
connector.addBean(alpnListener);
ALPNClientConnection connection = new ALPNClientConnection(endPoint, executor, getClientConnectionFactory(), sslEngine, context, protocols);
return customize(connection, context);
}
use of org.eclipse.jetty.util.component.ContainerLifeCycle in project jetty.project by eclipse.
the class SslConnectionFactory method configure.
@Override
protected AbstractConnection configure(AbstractConnection connection, Connector connector, EndPoint endPoint) {
if (connection instanceof SslConnection) {
SslConnection sslConnection = (SslConnection) connection;
if (connector instanceof ContainerLifeCycle) {
ContainerLifeCycle container = (ContainerLifeCycle) connector;
container.getBeans(SslHandshakeListener.class).forEach(sslConnection::addHandshakeListener);
}
getBeans(SslHandshakeListener.class).forEach(sslConnection::addHandshakeListener);
}
return super.configure(connection, connector, endPoint);
}
use of org.eclipse.jetty.util.component.ContainerLifeCycle in project jetty.project by eclipse.
the class MBeanContainerLifeCycleTest method prepare.
@Before
public void prepare() throws Exception {
container = new ContainerLifeCycle();
mbeanServer = ManagementFactory.getPlatformMBeanServer();
MBeanContainer mbeanContainer = new MBeanContainer(mbeanServer);
container.addBean(mbeanContainer);
container.start();
}
use of org.eclipse.jetty.util.component.ContainerLifeCycle in project jetty.project by eclipse.
the class MBeanContainerTest method setBeanAdded.
private void setBeanAdded() {
managed = new Managed();
Container container = new ContainerLifeCycle();
mbeanContainer.beanAdded(container, managed);
mbeanServer = mbeanContainer.getMBeanServer();
}
Aggregations