Java Code Examples for org.apache.catalina.Context#getWebappVersion()

The following examples show how to use org.apache.catalina.Context#getWebappVersion() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MapperListener.java    From Tomcat8-Source-Read with MIT License 6 votes vote down vote up
/**
 * 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));
    }
}
 
Example 2
Source File: MapperListener.java    From Tomcat8-Source-Read with MIT License 6 votes vote down vote up
/**
 * 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));
    }
}
 
Example 3
Source File: MapperListener.java    From Tomcat7.0.67 with Apache License 2.0 6 votes vote down vote up
/**
 * 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, connector));
    }
}
 
Example 4
Source File: MapperListener.java    From Tomcat7.0.67 with Apache License 2.0 6 votes vote down vote up
/**
 * 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<WrapperMappingInfo>();
    prepareWrapperMappingInfo(context, wrapper, wrappers);
    mapper.addWrappers(hostName, contextPath, version, wrappers);

    if(log.isDebugEnabled()) {
        log.debug(sm.getString("mapperListener.registerWrapper",
                wrapper.getName(), contextPath, connector));
    }
}
 
Example 5
Source File: MapperListener.java    From tomcatsrc with Apache License 2.0 6 votes vote down vote up
/**
 * 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, connector));
    }
}
 
Example 6
Source File: MapperListener.java    From tomcatsrc with Apache License 2.0 6 votes vote down vote up
/**
 * 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<WrapperMappingInfo>();
    prepareWrapperMappingInfo(context, wrapper, wrappers);
    mapper.addWrappers(hostName, contextPath, version, wrappers);

    if(log.isDebugEnabled()) {
        log.debug(sm.getString("mapperListener.registerWrapper",
                wrapper.getName(), contextPath, connector));
    }
}