当前位置: 首页>>代码示例>>Java>>正文


Java ServerInfo.getServerInfo方法代码示例

本文整理汇总了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);
}
 
开发者ID:masonmei,项目名称:apm-agent,代码行数:12,代码来源:StandardServiceModifierTest.java

示例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();
}
 
开发者ID:naver,项目名称:pinpoint,代码行数:12,代码来源:StandardServiceStartInterceptor.java

示例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);
        }
    }
}
 
开发者ID:apache,项目名称:tomee,代码行数:32,代码来源:ServerListener.java

示例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();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:9,代码来源:StandardServer.java

示例5: getServerVersion

import org.apache.catalina.util.ServerInfo; //导入方法依赖的package包/类
public String getServerVersion() {
    return(ServerInfo.getServerInfo());
}
 
开发者ID:c-rainstorm,项目名称:jerrydog,代码行数:4,代码来源:ClusterMemberInfo.java

示例6: populateMetaData

import org.apache.catalina.util.ServerInfo; //导入方法依赖的package包/类
private void populateMetaData() {
    String serverInfo = ServerInfo.getServerInfo();
    this.traceContext.getServerMetaDataHolder().setServerName(serverInfo);
}
 
开发者ID:masonmei,项目名称:apm-agent,代码行数:5,代码来源:StandardServiceStartInterceptor.java

示例7: getServerInfo

import org.apache.catalina.util.ServerInfo; //导入方法依赖的package包/类
public String getServerInfo() {
    return ServerInfo.getServerInfo();
}
 
开发者ID:andresol,项目名称:psi-probe-plus,代码行数:4,代码来源:SystemInformation.java

示例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();
}
 
开发者ID:BeamFoundry,项目名称:spring-osgi,代码行数:48,代码来源:Activator.java

示例9: checkServerInfo

import org.apache.catalina.util.ServerInfo; //导入方法依赖的package包/类
@Test
public void checkServerInfo() {
    final String serverInfo = ServerInfo.getServerInfo();
    assertTrue(serverInfo, serverInfo.startsWith("Apache Tomcat"));
}
 
开发者ID:apache,项目名称:tomee,代码行数:6,代码来源:CheckServerInfoTest.java

示例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());

}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:10,代码来源:ApplicationContext.java

示例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());

}
 
开发者ID:how2j,项目名称:lazycat,代码行数:10,代码来源:ApplicationContext.java

示例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();
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:8,代码来源:StandardServer.java

示例13: getServerInfo

import org.apache.catalina.util.ServerInfo; //导入方法依赖的package包/类
/**
 * Return the name and version of the servlet container.
 */
public String getServerInfo() {

    return (ServerInfo.getServerInfo());

}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:9,代码来源:ApplicationContext.java

示例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();
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:9,代码来源:StandardServer.java

示例15: getServerInfo

import org.apache.catalina.util.ServerInfo; //导入方法依赖的package包/类
/**
 * Gets the server info.
 *
 * @return the server info
 */
public String getServerInfo() {
  return ServerInfo.getServerInfo();
}
 
开发者ID:psi-probe,项目名称:psi-probe,代码行数:9,代码来源:SystemInformation.java


注:本文中的org.apache.catalina.util.ServerInfo.getServerInfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。