Java Code Examples for org.apache.catalina.Wrapper#getParent()

The following examples show how to use org.apache.catalina.Wrapper#getParent() . 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: ApplicationDispatcher.java    From Tomcat7.0.67 with Apache License 2.0 6 votes vote down vote up
/**
 * Construct a new instance of this class, configured according to the
 * specified parameters.  If both servletPath and pathInfo are
 * <code>null</code>, it will be assumed that this RequestDispatcher
 * was acquired by name, rather than by path.
 *
 * @param wrapper The Wrapper associated with the resource that will
 *  be forwarded to or included (required)
 * @param requestURI The request URI to this resource (if any)
 * @param servletPath The revised servlet path to this resource (if any)
 * @param pathInfo The revised extra path information to this resource
 *  (if any)
 * @param queryString Query string parameters included with this request
 *  (if any)
 * @param name Servlet name (if a named dispatcher was created)
 *  else <code>null</code>
 */
public ApplicationDispatcher
    (Wrapper wrapper, String requestURI, String servletPath,
     String pathInfo, String queryString, String name) {

    super();

    // Save all of our configuration parameters
    this.wrapper = wrapper;
    this.context = (Context) wrapper.getParent();
    this.requestURI = requestURI;
    this.servletPath = servletPath;
    this.pathInfo = pathInfo;
    this.queryString = queryString;
    this.name = name;
    if (wrapper instanceof StandardWrapper)
        this.support = ((StandardWrapper) wrapper).getInstanceSupport();
    else
        this.support = new InstanceSupport(wrapper);

}
 
Example 6
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 7
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));
    }
}
 
Example 8
Source File: ApplicationDispatcher.java    From tomcatsrc with Apache License 2.0 6 votes vote down vote up
/**
 * Construct a new instance of this class, configured according to the
 * specified parameters.  If both servletPath and pathInfo are
 * <code>null</code>, it will be assumed that this RequestDispatcher
 * was acquired by name, rather than by path.
 *
 * @param wrapper The Wrapper associated with the resource that will
 *  be forwarded to or included (required)
 * @param requestURI The request URI to this resource (if any)
 * @param servletPath The revised servlet path to this resource (if any)
 * @param pathInfo The revised extra path information to this resource
 *  (if any)
 * @param queryString Query string parameters included with this request
 *  (if any)
 * @param name Servlet name (if a named dispatcher was created)
 *  else <code>null</code>
 */
public ApplicationDispatcher
    (Wrapper wrapper, String requestURI, String servletPath,
     String pathInfo, String queryString, String name) {

    super();

    // Save all of our configuration parameters
    this.wrapper = wrapper;
    this.context = (Context) wrapper.getParent();
    this.requestURI = requestURI;
    this.servletPath = servletPath;
    this.pathInfo = pathInfo;
    this.queryString = queryString;
    this.name = name;
    if (wrapper instanceof StandardWrapper)
        this.support = ((StandardWrapper) wrapper).getInstanceSupport();
    else
        this.support = new InstanceSupport(wrapper);

}
 
Example 9
Source File: ApplicationDispatcher.java    From Tomcat8-Source-Read with MIT License 4 votes vote down vote up
/**
 * Construct a new instance of this class, configured according to the
 * specified parameters.  If both servletPath and pathInfo are
 * <code>null</code>, it will be assumed that this RequestDispatcher
 * was acquired by name, rather than by path.
 *
 * @param wrapper The Wrapper associated with the resource that will
 *  be forwarded to or included (required)
 * @param requestURI The request URI to this resource (if any)
 * @param servletPath The revised servlet path to this resource (if any)
 * @param pathInfo The revised extra path information to this resource
 *  (if any)
 * @param queryString Query string parameters included with this request
 *  (if any)
 * @param mapping The mapping for this resource (if any)
 * @param name Servlet name (if a named dispatcher was created)
 *  else <code>null</code>
 */
public ApplicationDispatcher
    (Wrapper wrapper, String requestURI, String servletPath,
     String pathInfo, String queryString, HttpServletMapping mapping, String name) {

    super();

    // Save all of our configuration parameters
    this.wrapper = wrapper;
    this.context = (Context) wrapper.getParent();
    this.requestURI = requestURI;
    this.servletPath = servletPath;
    this.pathInfo = pathInfo;
    this.queryString = queryString;
    this.mapping = mapping;
    this.name = name;
}