org.apache.catalina.session.StandardManager Java Examples

The following examples show how to use org.apache.catalina.session.StandardManager. 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 Tomcat8-Source-Read with MIT License 6 votes vote down vote up
/**
 * Create a new StandardManager.
 *
 * @param parent MBean Name of the associated parent component
 * @return the object name of the created manager
 *
 * @exception Exception if an MBean cannot be created or registered
 */
public String createStandardManager(String parent)
    throws Exception {

    // Create a new StandardManager instance
    StandardManager manager = new StandardManager();

    // Add the new instance to its parent component
    ObjectName pname = new ObjectName(parent);
    Container container = getParentContainerFromParent(pname);
    if (container instanceof Context) {
        ((Context) container).setManager(manager);
    } else {
        throw new Exception(sm.getString("mBeanFactory.managerContext"));
    }
    ObjectName oname = manager.getObjectName();
    if (oname != null) {
        return oname.toString();
    } else {
        return null;
    }

}
 
Example #2
Source File: ManagerSF.java    From Tomcat8-Source-Read with MIT License 6 votes vote down vote up
/**
 * Store the only the Manager elements
 *
 * @see NamingResourcesSF#storeChildren(PrintWriter, int, Object, StoreDescription)
 */
@Override
public void store(PrintWriter aWriter, int indent, Object aElement)
        throws Exception {
    StoreDescription elementDesc = getRegistry().findDescription(
            aElement.getClass());
    if (elementDesc != null) {
        if (aElement instanceof StandardManager) {
            StandardManager manager = (StandardManager) aElement;
            if (!isDefaultManager(manager)) {
                if (log.isDebugEnabled())
                    log.debug(sm.getString("factory.storeTag", elementDesc
                            .getTag(), aElement));
                super.store(aWriter, indent, aElement);
            }
        } else {
            super.store(aWriter, indent, aElement);
        }
    } else {
        if (log.isWarnEnabled())
            log.warn(sm.getString("factory.storeNoDescriptor", aElement
                    .getClass()));
    }
}
 
Example #3
Source File: MBeanFactory.java    From Tomcat7.0.67 with Apache License 2.0 6 votes vote down vote up
/**
 * Create a new StandardManager.
 *
 * @param parent MBean Name of the associated parent component
 *
 * @exception Exception if an MBean cannot be created or registered
 */
public String createStandardManager(String parent)
    throws Exception {

    // Create a new StandardManager instance
    StandardManager manager = new StandardManager();

    // Add the new instance to its parent component
    ObjectName pname = new ObjectName(parent);
    ContainerBase containerBase = getParentContainerFromParent(pname);
    if (containerBase != null) {
        containerBase.setManager(manager);
    } 
    ObjectName oname = manager.getObjectName();
    if (oname != null) {
        return (oname.toString());
    } else {
        return null;
    }
    
}
 
Example #4
Source File: MBeanFactory.java    From tomcatsrc with Apache License 2.0 6 votes vote down vote up
/**
 * Create a new StandardManager.
 *
 * @param parent MBean Name of the associated parent component
 *
 * @exception Exception if an MBean cannot be created or registered
 */
public String createStandardManager(String parent)
    throws Exception {

    // Create a new StandardManager instance
    StandardManager manager = new StandardManager();

    // Add the new instance to its parent component
    ObjectName pname = new ObjectName(parent);
    ContainerBase containerBase = getParentContainerFromParent(pname);
    if (containerBase != null) {
        containerBase.setManager(manager);
    } 
    ObjectName oname = manager.getObjectName();
    if (oname != null) {
        return (oname.toString());
    } else {
        return null;
    }
    
}
 
Example #5
Source File: ManagerSF.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
/**
 * Is this an instance of the default <code>Manager</code> configuration,
 * with all-default properties?
 *
 * @param smanager
 *            Manager to be tested
 * @return <code>true</code> if this is an instance of the default manager
 */
protected boolean isDefaultManager(StandardManager smanager) {

    if (!"SESSIONS.ser".equals(smanager.getPathname())
            || (smanager.getMaxActiveSessions() != -1)) {
        return false;
    }
    return true;

}
 
Example #6
Source File: DeltaSession.java    From Tomcat7.0.67 with Apache License 2.0 5 votes vote down vote up
public ClassLoader[] getClassLoaders() {
    if ( manager instanceof BackupManager ) return ((BackupManager)manager).getClassLoaders();
    else if ( manager instanceof ClusterManagerBase ) return ((ClusterManagerBase)manager).getClassLoaders();
    else if ( manager instanceof StandardManager ) {
        StandardManager sm = (StandardManager)manager;
        return ClusterManagerBase.getClassLoaders(sm.getContainer());
    } else if ( manager instanceof ManagerBase ) {
        ManagerBase mb = (ManagerBase)manager;
        return ClusterManagerBase.getClassLoaders(mb.getContainer());
    }//end if
    return null;
}
 
Example #7
Source File: DeltaSession.java    From tomcatsrc with Apache License 2.0 5 votes vote down vote up
public ClassLoader[] getClassLoaders() {
    if ( manager instanceof BackupManager ) return ((BackupManager)manager).getClassLoaders();
    else if ( manager instanceof ClusterManagerBase ) return ((ClusterManagerBase)manager).getClassLoaders();
    else if ( manager instanceof StandardManager ) {
        StandardManager sm = (StandardManager)manager;
        return ClusterManagerBase.getClassLoaders(sm.getContainer());
    } else if ( manager instanceof ManagerBase ) {
        ManagerBase mb = (ManagerBase)manager;
        return ClusterManagerBase.getClassLoaders(mb.getContainer());
    }//end if
    return null;
}