本文整理汇总了Java中org.apache.catalina.util.ServerInfo.getServerInfo方法的典型用法代码示例。如果您正苦于以下问题:Java ServerInfo.getServerInfo方法的具体用法?Java ServerInfo.getServerInfo怎么用?Java ServerInfo.getServerInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.catalina.util.ServerInfo
的用法示例。
在下文中一共展示了ServerInfo.getServerInfo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startShouldCollectServerInfo
import org.apache.catalina.util.ServerInfo; //导入方法依赖的package包/类
@Test
public void startShouldCollectServerInfo() throws Exception {
// Given
String expectedServerInfo = ServerInfo.getServerInfo();
// When
service.start();
service.stop();
// Then
ServerMetaData serverMetaData = getServerMetaData();
assertEquals(serverMetaData.getServerInfo(), expectedServerInfo);
}
示例2: after
import org.apache.catalina.util.ServerInfo; //导入方法依赖的package包/类
@Override
public void after(Object target, Object[] args, Object result, Throwable throwable) {
if (isDebug) {
logger.afterInterceptor(target, args, result, throwable);
}
String serverInfo = ServerInfo.getServerInfo();
ServerMetaDataHolder holder = this.traceContext.getServerMetaDataHolder();
holder.setServerName(serverInfo);
holder.notifyListeners();
}
示例3: installServerInfo
import org.apache.catalina.util.ServerInfo; //导入方法依赖的package包/类
private synchronized void installServerInfo() {
if (SystemInstance.get().getOptions().get("tomee.keep-server-info", false)) {
return;
}
// force static init
final String value = ServerInfo.getServerInfo();
Field field = null;
boolean acc = true;
try {
field = ServerInfo.class.getDeclaredField("serverInfo");
acc = field.isAccessible();
final int slash = value.indexOf('/');
field.setAccessible(true);
final String tomeeVersion = OpenEjbVersion.get().getVersion();
final int modifiers = field.getModifiers();
if (Modifier.isFinal(modifiers)) { // this is a bit fragile, we can surely drop this feature at some point
final Field modifiersField = Field.class.getDeclaredField("modifiers");
modifiersField.setAccessible(true);
modifiersField.setInt(field, modifiers & ~Modifier.FINAL);
}
field.set(null, value.substring(0, slash) + " (TomEE)" + value.substring(slash) + " (" + tomeeVersion + ")");
} catch (final Exception e) {
// no-op
} finally {
if (field != null) {
field.setAccessible(acc);
}
}
}
示例4: getServerInfo
import org.apache.catalina.util.ServerInfo; //导入方法依赖的package包/类
/**
* Report the current Tomcat Server Release number
* @return Tomcat release identifier
*/
public String getServerInfo() {
return ServerInfo.getServerInfo();
}
示例5: getServerVersion
import org.apache.catalina.util.ServerInfo; //导入方法依赖的package包/类
public String getServerVersion() {
return(ServerInfo.getServerInfo());
}
示例6: populateMetaData
import org.apache.catalina.util.ServerInfo; //导入方法依赖的package包/类
private void populateMetaData() {
String serverInfo = ServerInfo.getServerInfo();
this.traceContext.getServerMetaDataHolder().setServerName(serverInfo);
}
示例7: getServerInfo
import org.apache.catalina.util.ServerInfo; //导入方法依赖的package包/类
public String getServerInfo() {
return ServerInfo.getServerInfo();
}
示例8: start
import org.apache.catalina.util.ServerInfo; //导入方法依赖的package包/类
public void start(BundleContext context) throws Exception {
this.bundleContext = context;
// do the initialization on a different thread
// so the activator finishes fast
startupThread = new Thread(new Runnable() {
public void run() {
log.info("Starting " + ServerInfo.getServerInfo() + " ...");
// default startup procedure
ClassLoader cl = Activator.class.getClassLoader();
Thread current = Thread.currentThread();
ClassLoader old = current.getContextClassLoader();
try {
current.setContextClassLoader(cl);
server = createCatalinaServer(bundleContext.getBundle());
server.start();
Connector[] connectors = server.findConnectors();
for (int i = 0; i < connectors.length; i++) {
Connector conn = connectors[i];
log.info("Succesfully started " + ServerInfo.getServerInfo() + " @ " + conn.getDomain() + ":"
+ conn.getPort());
}
// register URL service
urlRegistration = registerTomcatJNDIUrlService();
// publish server as an OSGi service
registration = publishServerAsAService(server);
log.info("Published " + ServerInfo.getServerInfo() + " as an OSGi service");
}
catch (Exception ex) {
String msg = "Cannot start " + ServerInfo.getServerInfo();
log.error(msg, ex);
throw new RuntimeException(msg, ex);
}
finally {
current.setContextClassLoader(old);
}
}
}, "Tomcat Catalina Start Thread");
startupThread.start();
}
示例9: checkServerInfo
import org.apache.catalina.util.ServerInfo; //导入方法依赖的package包/类
@Test
public void checkServerInfo() {
final String serverInfo = ServerInfo.getServerInfo();
assertTrue(serverInfo, serverInfo.startsWith("Apache Tomcat"));
}
示例10: getServerInfo
import org.apache.catalina.util.ServerInfo; //导入方法依赖的package包/类
/**
* Return the name and version of the servlet container.
*/
@Override
public String getServerInfo() {
return (ServerInfo.getServerInfo());
}
示例11: getServerInfo
import org.apache.catalina.util.ServerInfo; //导入方法依赖的package包/类
/**
* Return the name and version of the servlet container.
*/
@Override
public String getServerInfo() {
return (ServerInfo.getServerInfo());
}
示例12: getServerInfo
import org.apache.catalina.util.ServerInfo; //导入方法依赖的package包/类
/**
* Report the current Tomcat Server Release number
* @return Tomcat release identifier
*/
public String getServerInfo() {
return ServerInfo.getServerInfo();
}
示例13: getServerInfo
import org.apache.catalina.util.ServerInfo; //导入方法依赖的package包/类
/**
* Return the name and version of the servlet container.
*/
public String getServerInfo() {
return (ServerInfo.getServerInfo());
}
示例14: getServerInfo
import org.apache.catalina.util.ServerInfo; //导入方法依赖的package包/类
/**
* Report the current Tomcat Server Release number
*
* @return Tomcat release identifier
*/
public String getServerInfo() {
return ServerInfo.getServerInfo();
}
示例15: getServerInfo
import org.apache.catalina.util.ServerInfo; //导入方法依赖的package包/类
/**
* Gets the server info.
*
* @return the server info
*/
public String getServerInfo() {
return ServerInfo.getServerInfo();
}