本文整理了Java中org.apache.catalina.Context.getWebappVersion()
方法的一些代码示例,展示了Context.getWebappVersion()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Context.getWebappVersion()
方法的具体详情如下:
包路径:org.apache.catalina.Context
类名称:Context
方法名:getWebappVersion
[英]Set the version of this web application - used to differentiate different versions of the same web application when using parallel deployment. If not specified, defaults to the empty string.
[中]设置此web应用程序的版本-用于在使用并行部署时区分同一web应用程序的不同版本。如果未指定,则默认为空字符串。
代码示例来源:origin: OryxProject/oryx
private static void doTestServingLayer(Config config) throws IOException {
try (ServingLayer servingLayer = new ServingLayer(config)) {
servingLayer.start();
Context context = servingLayer.getContext();
assertNotNull(context.findErrorPage(500));
assertEquals(0, context.getApplicationLifecycleListeners().length);
assertNotNull(context.findParameter(ConfigUtils.class.getName() + ".serialized"));
assertNotNull(context.getName());
assertGreaterOrEqual(Double.parseDouble(context.getWebappVersion()), 3.1);
}
}
代码示例来源:origin: org.apache.tomcat/tomcat-catalina
/**
* Register wrapper.
*/
private void registerWrapper(Wrapper wrapper) {
Context context = (Context) wrapper.getParent();
String contextPath = context.getPath();
if ("/".equals(contextPath)) {
contextPath = "";
}
String version = context.getWebappVersion();
String hostName = context.getParent().getName();
List<WrapperMappingInfo> wrappers = new ArrayList<>();
prepareWrapperMappingInfo(context, wrapper, wrappers);
mapper.addWrappers(hostName, contextPath, version, wrappers);
if(log.isDebugEnabled()) {
log.debug(sm.getString("mapperListener.registerWrapper",
wrapper.getName(), contextPath, service));
}
}
代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core
/**
* Register wrapper.
*/
private void registerWrapper(Wrapper wrapper) {
Context context = (Context) wrapper.getParent();
String contextPath = context.getPath();
if ("/".equals(contextPath)) {
contextPath = "";
}
String version = context.getWebappVersion();
String hostName = context.getParent().getName();
List<WrapperMappingInfo> wrappers = new ArrayList<>();
prepareWrapperMappingInfo(context, wrapper, wrappers);
mapper.addWrappers(hostName, contextPath, version, wrappers);
if(log.isDebugEnabled()) {
log.debug(sm.getString("mapperListener.registerWrapper",
wrapper.getName(), contextPath, service));
}
}
代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9
/**
* Unregister context.
*/
private void unregisterContext(Context context) {
// Don't un-map a context that is paused
if (context.getPaused()){
return;
}
String contextPath = context.getPath();
if ("/".equals(contextPath)) {
contextPath = "";
}
String hostName = context.getParent().getName();
if(log.isDebugEnabled())
log.debug(sm.getString("mapperListener.unregisterContext",
contextPath, connector));
mapper.removeContextVersion(hostName, contextPath,
context.getWebappVersion());
}
代码示例来源:origin: codefollower/Tomcat-Research
/**
* Unregister context.
*/
private void unregisterContext(Context context) {
// Don't un-map a context that is paused
if (context.getPaused()){
return;
}
String contextPath = context.getPath();
if ("/".equals(contextPath)) {
contextPath = "";
}
String hostName = context.getParent().getName();
if(log.isDebugEnabled()) {
log.debug(sm.getString("mapperListener.unregisterContext",
contextPath, service));
}
mapper.removeContextVersion(context, hostName, contextPath,
context.getWebappVersion());
}
代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9
/**
* Unregister context.
*/
private void unregisterContext(Context context) {
// Don't un-map a context that is paused
if (context.getPaused()){
return;
}
String contextPath = context.getPath();
if ("/".equals(contextPath)) {
contextPath = "";
}
String hostName = context.getParent().getName();
if(log.isDebugEnabled())
log.debug(sm.getString("mapperListener.unregisterContext",
contextPath, connector));
mapper.removeContextVersion(hostName, contextPath,
context.getWebappVersion());
}
代码示例来源:origin: org.apache.catalina/com.springsource.org.apache.catalina
/**
* Unregister context.
*/
private void unregisterContext(Context context) {
// Don't un-map a context that is paused
if (context.getPaused()){
return;
}
String contextPath = context.getPath();
if ("/".equals(contextPath)) {
contextPath = "";
}
String hostName = context.getParent().getName();
if(log.isDebugEnabled()) {
log.debug(sm.getString("mapperListener.unregisterContext",
contextPath, connector));
}
mapper.removeContextVersion(hostName, contextPath,
context.getWebappVersion());
}
代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7
/**
* Unregister context.
*/
private void unregisterContext(Context context) {
// Don't un-map a context that is paused
if (context.getPaused()){
return;
}
String contextPath = context.getPath();
if ("/".equals(contextPath)) {
contextPath = "";
}
String hostName = context.getParent().getName();
if(log.isDebugEnabled())
log.debug(sm.getString("mapperListener.unregisterContext",
contextPath, connector));
mapper.removeContextVersion(hostName, contextPath,
context.getWebappVersion());
}
代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina
/**
* Unregister context.
*/
private void unregisterContext(Context context) {
// Don't un-map a context that is paused
if (context.getPaused()){
return;
}
String contextPath = context.getPath();
if ("/".equals(contextPath)) {
contextPath = "";
}
String hostName = context.getParent().getName();
if(log.isDebugEnabled()) {
log.debug(sm.getString("mapperListener.unregisterContext",
contextPath, connector));
}
mapper.removeContextVersion(hostName, contextPath,
context.getWebappVersion());
}
代码示例来源:origin: org.apache.tomcat/tomcat-catalina
/**
* Unregister wrapper.
*/
private void unregisterWrapper(Wrapper wrapper) {
Context context = ((Context) wrapper.getParent());
String contextPath = context.getPath();
String wrapperName = wrapper.getName();
if ("/".equals(contextPath)) {
contextPath = "";
}
String version = context.getWebappVersion();
String hostName = context.getParent().getName();
String[] mappings = wrapper.findMappings();
for (String mapping : mappings) {
mapper.removeWrapper(hostName, contextPath, version, mapping);
}
if(log.isDebugEnabled()) {
log.debug(sm.getString("mapperListener.unregisterWrapper",
wrapperName, contextPath, service));
}
}
代码示例来源:origin: codefollower/Tomcat-Research
/**
* Register context.
*/
private void registerContext(Context context) {
String contextPath = context.getPath();
if ("/".equals(contextPath)) {
contextPath = "";
}
Host host = (Host)context.getParent();
WebResourceRoot resources = context.getResources();
String[] welcomeFiles = context.findWelcomeFiles();
mapper.addContextVersion(host.getName(), host, contextPath,
context.getWebappVersion(), context, welcomeFiles, resources);
for (Container container : context.findChildren()) {
registerWrapper((Wrapper) container);
}
if(log.isDebugEnabled()) {
log.debug(sm.getString("mapperListener.registerContext",
contextPath, service));
}
}
代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9
/**
* Register context.
*/
private void registerContext(Context context) {
String contextPath = context.getPath();
if ("/".equals(contextPath)) {
contextPath = "";
}
Container host = context.getParent();
javax.naming.Context resources = context.getResources();
String[] welcomeFiles = context.findWelcomeFiles();
mapper.addContextVersion(host.getName(), host, contextPath,
context.getWebappVersion(), context, welcomeFiles, resources);
for (Container container : context.findChildren()) {
registerWrapper((Wrapper) container);
}
if(log.isDebugEnabled()) {
log.debug(sm.getString("mapperListener.registerContext",
contextPath, connector));
}
}
代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7
/**
* Register context.
*/
private void registerContext(Context context) {
String contextPath = context.getPath();
if ("/".equals(contextPath)) {
contextPath = "";
}
Container host = context.getParent();
javax.naming.Context resources = context.getResources();
String[] welcomeFiles = context.findWelcomeFiles();
mapper.addContextVersion(host.getName(), host, contextPath,
context.getWebappVersion(), context, welcomeFiles, resources);
for (Container container : context.findChildren()) {
registerWrapper((Wrapper) container);
}
if(log.isDebugEnabled()) {
log.debug(sm.getString("mapperListener.registerContext",
contextPath, connector));
}
}
代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina
/**
* Register context.
*/
private void registerContext(Context context) {
String contextPath = context.getPath();
if ("/".equals(contextPath)) {
contextPath = "";
}
Container host = context.getParent();
javax.naming.Context resources = context.getResources();
String[] welcomeFiles = context.findWelcomeFiles();
mapper.addContextVersion(host.getName(), host, contextPath,
context.getWebappVersion(), context, welcomeFiles, resources);
for (Container container : context.findChildren()) {
registerWrapper((Wrapper) container);
}
if(log.isDebugEnabled()) {
log.debug(sm.getString("mapperListener.registerContext",
contextPath, connector));
}
}
代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9
/**
* Unregister wrapper.
*/
private void unregisterWrapper(Wrapper wrapper) {
String contextPath = ((Context) wrapper.getParent()).getPath();
String wrapperName = wrapper.getName();
if ("/".equals(contextPath)) {
contextPath = "";
}
String version = ((Context) wrapper.getParent()).getWebappVersion();
String hostName = wrapper.getParent().getParent().getName();
String[] mappings = wrapper.findMappings();
for (String mapping : mappings) {
mapper.removeWrapper(hostName, contextPath, version, mapping);
}
if(log.isDebugEnabled()) {
log.debug(sm.getString("mapperListener.unregisterWrapper",
wrapperName, contextPath, connector));
}
}
代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7
/**
* Unregister wrapper.
*/
private void unregisterWrapper(Wrapper wrapper) {
String contextPath = ((Context) wrapper.getParent()).getPath();
String wrapperName = wrapper.getName();
if ("/".equals(contextPath)) {
contextPath = "";
}
String version = ((Context) wrapper.getParent()).getWebappVersion();
String hostName = wrapper.getParent().getParent().getName();
String[] mappings = wrapper.findMappings();
for (String mapping : mappings) {
mapper.removeWrapper(hostName, contextPath, version, mapping);
}
if(log.isDebugEnabled()) {
log.debug(sm.getString("mapperListener.unregisterWrapper",
wrapperName, contextPath, connector));
}
}
代码示例来源:origin: codefollower/Tomcat-Research
/**
* Unregister wrapper.
*/
private void unregisterWrapper(Wrapper wrapper) {
String contextPath = ((Context) wrapper.getParent()).getPath();
String wrapperName = wrapper.getName();
if ("/".equals(contextPath)) {
contextPath = "";
}
String version = ((Context) wrapper.getParent()).getWebappVersion();
String hostName = wrapper.getParent().getParent().getName();
String[] mappings = wrapper.findMappings();
for (String mapping : mappings) {
mapper.removeWrapper(hostName, contextPath, version, mapping);
}
if(log.isDebugEnabled()) {
log.debug(sm.getString("mapperListener.unregisterWrapper",
wrapperName, contextPath, service));
}
}
代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina
/**
* Unregister wrapper.
*/
private void unregisterWrapper(Wrapper wrapper) {
String contextPath = ((Context) wrapper.getParent()).getPath();
String wrapperName = wrapper.getName();
if ("/".equals(contextPath)) {
contextPath = "";
}
String version = ((Context) wrapper.getParent()).getWebappVersion();
String hostName = wrapper.getParent().getParent().getName();
String[] mappings = wrapper.findMappings();
for (String mapping : mappings) {
mapper.removeWrapper(hostName, contextPath, version, mapping);
}
if(log.isDebugEnabled()) {
log.debug(sm.getString("mapperListener.unregisterWrapper",
wrapperName, contextPath, connector));
}
}
代码示例来源:origin: org.apache.catalina/com.springsource.org.apache.catalina
/**
* Unregister wrapper.
*/
private void unregisterWrapper(Wrapper wrapper) {
String contextPath = ((Context) wrapper.getParent()).getPath();
String wrapperName = wrapper.getName();
if ("/".equals(contextPath)) {
contextPath = "";
}
String version = ((Context) wrapper.getParent()).getWebappVersion();
String hostName = wrapper.getParent().getParent().getName();
String[] mappings = wrapper.findMappings();
for (String mapping : mappings) {
mapper.removeWrapper(hostName, contextPath, version, mapping);
}
if(log.isDebugEnabled()) {
log.debug(sm.getString("mapperListener.unregisterWrapper",
wrapperName, contextPath, connector));
}
}
代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9
/**
* Unregister wrapper.
*/
private void unregisterWrapper(Wrapper wrapper) {
String contextPath = ((Context) wrapper.getParent()).getPath();
String wrapperName = wrapper.getName();
if ("/".equals(contextPath)) {
contextPath = "";
}
String version = ((Context) wrapper.getParent()).getWebappVersion();
String hostName = wrapper.getParent().getParent().getName();
String[] mappings = wrapper.findMappings();
for (String mapping : mappings) {
mapper.removeWrapper(hostName, contextPath, version, mapping);
}
if(log.isDebugEnabled()) {
log.debug(sm.getString("mapperListener.unregisterWrapper",
wrapperName, contextPath, connector));
}
}
内容来源于网络,如有侵权,请联系作者删除!