use of org.apache.catalina.core.StandardHost in project pinpoint by naver.
the class StandardHostValveInvokeModifierTest method setUp.
/**
* Sets the up.
*
* @throws Exception the exception
*/
@Before
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
initMockRequest();
// StandardHost's default constructor sets StandardHostValve as the first item in the pipeline.
host = new StandardHost();
}
use of org.apache.catalina.core.StandardHost in project pinpoint by naver.
the class StandardHostValveInvokeModifierTest method setUp.
@Before
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
initMockRequest();
// StandardHost's default constructor sets StandardHostValve as the first item in the pipeline.
host = new StandardHost();
}
use of org.apache.catalina.core.StandardHost in project micrometer by micrometer-metrics.
the class TomcatMetricsTest method mbeansAvailableAfterBinder.
@Test
void mbeansAvailableAfterBinder() throws LifecycleException, InterruptedException {
TomcatMetrics.monitor(registry, null);
CountDownLatch latch = new CountDownLatch(1);
registry.config().onMeterAdded(m -> {
if (m.getId().getName().equals("tomcat.global.received"))
latch.countDown();
});
Tomcat server = new Tomcat();
try {
StandardHost host = new StandardHost();
host.setName("localhost");
server.setHost(host);
server.setPort(61000);
server.start();
assertThat(latch.await(10, TimeUnit.SECONDS)).isTrue();
registry.find("tomcat.global.received").functionCounter();
} finally {
server.stop();
server.destroy();
}
}
use of org.apache.catalina.core.StandardHost in project micrometer by micrometer-metrics.
the class TomcatMetricsTest method mbeansAvailableBeforeBinder.
@Test
void mbeansAvailableBeforeBinder() throws LifecycleException {
Tomcat server = new Tomcat();
try {
StandardHost host = new StandardHost();
host.setName("localhost");
server.setHost(host);
server.setPort(61000);
server.start();
TomcatMetrics.monitor(registry, null);
registry.find("tomcat.global.received").functionCounter();
} finally {
server.stop();
server.destroy();
}
}
use of org.apache.catalina.core.StandardHost in project ofbiz-framework by apache.
the class CatalinaContainer method prepareHost.
private Host prepareHost(Tomcat tomcat, List<String> virtualHosts) {
Host host;
if (UtilValidate.isEmpty(virtualHosts)) {
host = tomcat.getHost();
} else {
host = prepareVirtualHost(tomcat, virtualHosts);
}
host.setAppBase(System.getProperty("ofbiz.home") + "/framework/catalina/hosts");
host.setDeployOnStartup(false);
host.setBackgroundProcessorDelay(5);
host.setAutoDeploy(false);
((StandardHost) host).setWorkDir(new File(System.getProperty(Globals.CATALINA_HOME_PROP), "work" + File.separator + host.getName()).getAbsolutePath());
return host;
}
Aggregations