Java Code Examples for org.apache.catalina.Manager#getContainer()

The following examples show how to use org.apache.catalina.Manager#getContainer() . 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: SimpleTcpCluster.java    From Tomcat7.0.67 with Apache License 2.0 6 votes vote down vote up
/**
 * @param name
 * @param manager
 * @return TODO
 */
@Override
public String getManagerName(String name, Manager manager) {
    String clusterName = name ;
    if ( clusterName == null ) clusterName = manager.getContainer().getName();
    if(getContainer() instanceof Engine) {
        Container context = manager.getContainer() ;
        if(context != null && context instanceof Context) {
            Container host = ((Context)context).getParent();
            if(host != null && host instanceof Host && clusterName!=null && 
                    !(clusterName.startsWith(host.getName() +"#"))) {
                clusterName = host.getName() +"#" + clusterName ;
            }
        }
    }
    return clusterName;
}
 
Example 2
Source File: SingleSignOnListener.java    From Tomcat7.0.67 with Apache License 2.0 6 votes vote down vote up
@Override
public void sessionEvent(SessionEvent event) {
    if (!Session.SESSION_DESTROYED_EVENT.equals(event.getType())) {
        return;
    }

    Session session = event.getSession();
    Manager manager = session.getManager();
    if (manager == null) {
        return;
    }
    Context context = (Context) manager.getContainer();
    if (context == null) {
        return;
    }
    Authenticator authenticator = context.getAuthenticator();
    if (!(authenticator instanceof AuthenticatorBase)) {
        return;
    }
    SingleSignOn sso = ((AuthenticatorBase) authenticator).sso;
    if (sso == null) {
        return;
    }
    sso.sessionDestroyed(ssoId, session);
}
 
Example 3
Source File: SingleSignOnListener.java    From tomcatsrc with Apache License 2.0 6 votes vote down vote up
@Override
public void sessionEvent(SessionEvent event) {
    if (!Session.SESSION_DESTROYED_EVENT.equals(event.getType())) {
        return;
    }

    Session session = event.getSession();
    Manager manager = session.getManager();
    if (manager == null) {
        return;
    }
    Context context = (Context) manager.getContainer();
    Authenticator authenticator = context.getAuthenticator();
    if (!(authenticator instanceof AuthenticatorBase)) {
        return;
    }
    SingleSignOn sso = ((AuthenticatorBase) authenticator).sso;
    if (sso == null) {
        return;
    }
    sso.sessionDestroyed(ssoId, session);
}
 
Example 4
Source File: SimpleTcpCluster.java    From tomcatsrc with Apache License 2.0 5 votes vote down vote up
/**
 * @param name
 * @param manager
 * @return TODO
 */
@Override
public String getManagerName(String name, Manager manager) {
    String clusterName = name ;
    if (clusterName == null) clusterName = manager.getContainer().getName();
    if (getContainer() instanceof Engine) {
        Context context = (Context) manager.getContainer() ;
        Container host = context.getParent();
        if (host instanceof Host && clusterName != null && 
                !(clusterName.startsWith(host.getName() +"#"))) {
            clusterName = host.getName() +"#" + clusterName ;
        }
    }
    return clusterName;
}