## org.mortbay.jetty.servlet
Class AbstractSessionIdManager

    java.lang.Object
      org.mortbay.component.AbstractLifeCycle
          org.mortbay.jetty.servlet.AbstractSessionIdManager

All Implemented Interfaces:
  LifeCycle, SessionIdManager

    public abstract class AbstractSessionIdManager

extends AbstractLifeCycle
implements SessionIdManager

Nested Class Summary

Nested classes/interfaces inherited from interface org.mortbay.component.LifeCycle
`LifeCycle.Listener`

Field Summary
`protected java.util.Random` `_random`
`protected Server` `_server`
`protected boolean` `_weakRandom`
`protected java.lang.String` `_workerName`

Fields inherited from class org.mortbay.component.AbstractLifeCycle
`_listeners`

Constructor Summary
`AbstractSessionIdManager(Server server)`
`AbstractSessionIdManager(Server server, java.util.Random random)`

Method Summary
`void` `doStart()`
`java.util.Random` `getRandom()`
`java.lang.String` `getWorkerName()`
`void` `initRandom()` Set up a random number generator for the sessionids.
`java.lang.String` `newSessionId(javax.servlet.http.HttpServletRequest request, long created)` Create a new session id if necessary.
`void` `setRandom(java.util.Random random)`
`void` `setWorkerName(java.lang.String name)`

Methods inherited from class org.mortbay.component.AbstractLifeCycle
`addLifeCycleListener, doStop, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface org.mortbay.jetty.SessionIdManager
`addSession, getClusterId, getNodeId, idInUse, invalidateAll, removeSession`

Methods inherited from interface org.mortbay.component.LifeCycle
`addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop`

Field Detail

### _random

    protected java.util.Random _random

### _weakRandom

    protected boolean _weakRandom

### _workerName

    protected java.lang.String _workerName

### _server

    protected Server _server

Constructor Detail

### AbstractSessionIdManager

    public AbstractSessionIdManager(Server server)

### AbstractSessionIdManager

    public AbstractSessionIdManager(Server server,
                                    java.util.Random random)

Method Detail

### getWorkerName

    public java.lang.String getWorkerName()

  Specified by:
    `getWorkerName` in interface `SessionIdManager`

### setWorkerName

    public void setWorkerName(java.lang.String name)

### getRandom

    public java.util.Random getRandom()

### setRandom

    public void setRandom(java.util.Random random)

### newSessionId

    public java.lang.String newSessionId(javax.servlet.http.HttpServletRequest request,
                                         long created)

  Create a new session id if necessary.

  Specified by:
    `newSessionId` in interface `SessionIdManager`
  Returns:
  See Also:
    `SessionIdManager.newSessionId(javax.servlet.http.HttpServletRequest, long)`

### doStart

    public void doStart()

  Overrides:
    `doStart` in class `AbstractLifeCycle`

### initRandom

    public void initRandom()

  Set up a random number generator for the sessionids. By preference, use a SecureRandom but allow to be injected.

Copyright © 1995-2010 Mort Bay Consulting. All Rights Reserved.