Search in sources :

Example 1 with SessionIdGeneratorBase

use of org.apache.catalina.util.SessionIdGeneratorBase in project tomcat70 by apache.

the class ManagerBase method startInternal.

@Override
protected void startInternal() throws LifecycleException {
    // nulls.
    while (sessionCreationTiming.size() < TIMING_STATS_CACHE_SIZE) {
        sessionCreationTiming.add(null);
    }
    while (sessionExpirationTiming.size() < TIMING_STATS_CACHE_SIZE) {
        sessionExpirationTiming.add(null);
    }
    /* Create sessionIdGenerator if not explicitly configured */
    SessionIdGenerator sessionIdGenerator = getSessionIdGenerator();
    if (sessionIdGenerator == null) {
        sessionIdGenerator = new StandardSessionIdGenerator();
        setSessionIdGenerator(sessionIdGenerator);
    }
    if (sessionIdLength != SESSION_ID_LENGTH_UNSET) {
        sessionIdGenerator.setSessionIdLength(sessionIdLength);
    }
    sessionIdGenerator.setJvmRoute(getJvmRoute());
    if (sessionIdGenerator instanceof SessionIdGeneratorBase) {
        SessionIdGeneratorBase sig = (SessionIdGeneratorBase) sessionIdGenerator;
        sig.setSecureRandomAlgorithm(getSecureRandomAlgorithm());
        sig.setSecureRandomClass(getSecureRandomClass());
        sig.setSecureRandomProvider(getSecureRandomProvider());
    }
    if (sessionIdGenerator instanceof Lifecycle) {
        ((Lifecycle) sessionIdGenerator).start();
    } else {
        // Force initialization of the random number generator
        if (log.isDebugEnabled())
            log.debug("Force random number initialization starting");
        sessionIdGenerator.generateSessionId();
        if (log.isDebugEnabled())
            log.debug("Force random number initialization completed");
    }
}
Also used : StandardSessionIdGenerator(org.apache.catalina.util.StandardSessionIdGenerator) Lifecycle(org.apache.catalina.Lifecycle) SessionIdGenerator(org.apache.catalina.SessionIdGenerator) StandardSessionIdGenerator(org.apache.catalina.util.StandardSessionIdGenerator) SessionIdGeneratorBase(org.apache.catalina.util.SessionIdGeneratorBase)

Example 2 with SessionIdGeneratorBase

use of org.apache.catalina.util.SessionIdGeneratorBase in project tomcat by apache.

the class ManagerBase method startInternal.

@Override
protected void startInternal() throws LifecycleException {
    // nulls.
    while (sessionCreationTiming.size() < TIMING_STATS_CACHE_SIZE) {
        sessionCreationTiming.add(null);
    }
    while (sessionExpirationTiming.size() < TIMING_STATS_CACHE_SIZE) {
        sessionExpirationTiming.add(null);
    }
    /* Create sessionIdGenerator if not explicitly configured */
    SessionIdGenerator sessionIdGenerator = getSessionIdGenerator();
    if (sessionIdGenerator == null) {
        sessionIdGenerator = new StandardSessionIdGenerator();
        setSessionIdGenerator(sessionIdGenerator);
    }
    sessionIdGenerator.setJvmRoute(getJvmRoute());
    if (sessionIdGenerator instanceof SessionIdGeneratorBase) {
        SessionIdGeneratorBase sig = (SessionIdGeneratorBase) sessionIdGenerator;
        sig.setSecureRandomAlgorithm(getSecureRandomAlgorithm());
        sig.setSecureRandomClass(getSecureRandomClass());
        sig.setSecureRandomProvider(getSecureRandomProvider());
    }
    if (sessionIdGenerator instanceof Lifecycle) {
        ((Lifecycle) sessionIdGenerator).start();
    } else {
        // Force initialization of the random number generator
        if (log.isDebugEnabled()) {
            log.debug("Force random number initialization starting");
        }
        sessionIdGenerator.generateSessionId();
        if (log.isDebugEnabled()) {
            log.debug("Force random number initialization completed");
        }
    }
}
Also used : StandardSessionIdGenerator(org.apache.catalina.util.StandardSessionIdGenerator) Lifecycle(org.apache.catalina.Lifecycle) SessionIdGenerator(org.apache.catalina.SessionIdGenerator) StandardSessionIdGenerator(org.apache.catalina.util.StandardSessionIdGenerator) SessionIdGeneratorBase(org.apache.catalina.util.SessionIdGeneratorBase)

Aggregations

Lifecycle (org.apache.catalina.Lifecycle)2 SessionIdGenerator (org.apache.catalina.SessionIdGenerator)2 SessionIdGeneratorBase (org.apache.catalina.util.SessionIdGeneratorBase)2 StandardSessionIdGenerator (org.apache.catalina.util.StandardSessionIdGenerator)2