Java Code Examples for org.apache.catalina.core.ContainerBase#setLoader()

The following examples show how to use org.apache.catalina.core.ContainerBase#setLoader() . 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: MBeanFactory.java    From Tomcat7.0.67 with Apache License 2.0 6 votes vote down vote up
/**
 * Create a new Web Application Loader.
 *
 * @param parent MBean Name of the associated parent component
 *
 * @exception Exception if an MBean cannot be created or registered
 */
public String createWebappLoader(String parent)
    throws Exception {

    // Create a new WebappLoader instance
    WebappLoader loader = new WebappLoader();

    // Add the new instance to its parent component
    ObjectName pname = new ObjectName(parent);
    ContainerBase containerBase = getParentContainerFromParent(pname);
    if (containerBase != null) {
        containerBase.setLoader(loader);
    } 
    // FIXME add Loader.getObjectName
    //ObjectName oname = loader.getObjectName();
    ObjectName oname = 
        MBeanUtils.createObjectName(pname.getDomain(), loader);
    return (oname.toString());
    
}
 
Example 2
Source File: MBeanFactory.java    From tomcatsrc with Apache License 2.0 6 votes vote down vote up
/**
 * Create a new Web Application Loader.
 *
 * @param parent MBean Name of the associated parent component
 *
 * @exception Exception if an MBean cannot be created or registered
 */
public String createWebappLoader(String parent)
    throws Exception {

    // Create a new WebappLoader instance
    WebappLoader loader = new WebappLoader();

    // Add the new instance to its parent component
    ObjectName pname = new ObjectName(parent);
    ContainerBase containerBase = getParentContainerFromParent(pname);
    if (containerBase != null) {
        containerBase.setLoader(loader);
    } 
    // FIXME add Loader.getObjectName
    //ObjectName oname = loader.getObjectName();
    ObjectName oname = 
        MBeanUtils.createObjectName(pname.getDomain(), loader);
    return (oname.toString());
    
}
 
Example 3
Source File: MBeanFactory.java    From Tomcat7.0.67 with Apache License 2.0 5 votes vote down vote up
/**
 * Remove an existing Loader.
 *
 * @param name MBean Name of the component to remove
 *
 * @exception Exception if a component cannot be removed
 */
public void removeLoader(String name) throws Exception {

    ObjectName oname = new ObjectName(name);
    // Acquire a reference to the component to be removed
    ContainerBase container = getParentContainerFromChild(oname);    
    container.setLoader(null);
    
}
 
Example 4
Source File: MBeanFactory.java    From tomcatsrc with Apache License 2.0 5 votes vote down vote up
/**
 * Remove an existing Loader.
 *
 * @param name MBean Name of the component to remove
 *
 * @exception Exception if a component cannot be removed
 */
public void removeLoader(String name) throws Exception {

    ObjectName oname = new ObjectName(name);
    // Acquire a reference to the component to be removed
    ContainerBase container = getParentContainerFromChild(oname);    
    container.setLoader(null);
    
}