Top Description Inners Fields Constructors Methods
org.eclipse.jetty.session

public Class HouseKeeper

extends AbstractLifeCycle
Class Inheritance
Annotations
@ManagedObject
Imports
java.util.concurrent.TimeUnit, org.eclipse.jetty.util.annotation.ManagedAttribute, .ManagedObject, org.eclipse.jetty.util.component.AbstractLifeCycle, org.eclipse.jetty.util.thread.AutoLock, .ScheduledExecutorScheduler, .Scheduler, org.slf4j.Logger, .LoggerFactory

HouseKeeper There is 1 session HouseKeeper per SessionIdManager instance.

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected class

Field Summary

Modifier and TypeField and Description
private long
private final AutoLock
protected boolean
protected HouseKeeper.Runner
protected Scheduler
protected SessionIdManager
protected Scheduler.Task
public static final long
private static final Logger
Inherited from org.eclipse.jetty.util.component.AbstractLifeCycle:
FAILEDSTARTEDSTARTINGSTOPPEDSTOPPING

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
doStart()

Overrides org.eclipse.jetty.util.component.AbstractLifeCycle.doStart.

Method to override to start the lifecycle

protected void
doStop()

Overrides org.eclipse.jetty.util.component.AbstractLifeCycle.doStop.

Method to override to stop the lifecycle

public long

Returns:

the interval (in seconds)
getIntervalSec
()

Get the period between scavenge cycles.

public void
scavenge()

Periodically do session housekeeping

public void
setIntervalSec(long
the interval (in seconds)
sec
)

Set the period between scavenge cycles

public void
setSessionIdManager(SessionIdManager
the session id manager
sessionIdManager
)

SessionIdManager associated with this scavenger

protected void
startScavenging()

If scavenging is not scheduled, schedule it.

protected void
stopScavenging()

If scavenging is scheduled, stop it.

public String
toString()

Overrides org.eclipse.jetty.util.component.AbstractLifeCycle.toString.

Returns a string representation of the object.

Inherited from org.eclipse.jetty.util.component.AbstractLifeCycle:
addEventListenergetEventListenersgetStategetStateisFailedisRunningisStartedisStartingisStoppedisStoppingremoveEventListenersetEventListenersstartstop

Field Detail

_intervalMsback to summary
private long _intervalMs
_lockback to summary
private final AutoLock _lock

Hides org.eclipse.jetty.util.component.AbstractLifeCycle._lock.

_ownSchedulerback to summary
protected boolean _ownScheduler
_runnerback to summary
protected HouseKeeper.Runner _runner
_schedulerback to summary
protected Scheduler _scheduler
_sessionIdManagerback to summary
protected SessionIdManager _sessionIdManager
_taskback to summary
protected Scheduler.Task _task
DEFAULT_PERIOD_MSback to summary
public static final long DEFAULT_PERIOD_MS
LOGback to summary
private static final Logger LOG

Hides org.eclipse.jetty.util.component.AbstractLifeCycle.LOG.

Constructor Detail

HouseKeeperback to summary
public HouseKeeper()

Method Detail

doStartback to summary
protected void doStart() throws Exception

Overrides org.eclipse.jetty.util.component.AbstractLifeCycle.doStart.

Doc from org.eclipse.jetty.util.component.AbstractLifeCycle.doStart.

Method to override to start the lifecycle

Annotations
@Override
Exceptions
Exception:
If there was a problem starting. Will cause a transition to FAILED state
doStopback to summary
protected void doStop() throws Exception

Overrides org.eclipse.jetty.util.component.AbstractLifeCycle.doStop.

Doc from org.eclipse.jetty.util.component.AbstractLifeCycle.doStop.

Method to override to stop the lifecycle

Annotations
@Override
Exceptions
Exception:
If there was a problem stopping. Will cause a transition to FAILED state
getIntervalSecback to summary
public long getIntervalSec()

Get the period between scavenge cycles.

Returns:long

the interval (in seconds)

Annotations
@ManagedAttribute:secs between scavenge cycles
readonly:true
scavengeback to summary
public void scavenge()

Periodically do session housekeeping

setIntervalSecback to summary
public void setIntervalSec(long sec) throws Exception

Set the period between scavenge cycles

Parameters
sec:long

the interval (in seconds)

Exceptions
Exception:
if any error during restarting the scavenging
setSessionIdManagerback to summary
public void setSessionIdManager(SessionIdManager sessionIdManager)

SessionIdManager associated with this scavenger

Parameters
sessionIdManager:SessionIdManager

the session id manager

startScavengingback to summary
protected void startScavenging() throws Exception

If scavenging is not scheduled, schedule it.

Exceptions
Exception:
if any error during scheduling the scavenging
stopScavengingback to summary
protected void stopScavenging() throws Exception

If scavenging is scheduled, stop it.

Exceptions
Exception:
if any error during stopping the scavenging
toStringback to summary
public String toString()

Overrides org.eclipse.jetty.util.component.AbstractLifeCycle.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
org.eclipse.jetty.session back to summary

protected Class HouseKeeper.Runner

extends Object
implements Runnable
Class Inheritance
All Implemented Interfaces
java.lang.Runnable

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public void
run()

Implements java.lang.Runnable.run.

Runs this operation.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Runnerback to summary
protected Runner()

Method Detail

runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

Annotations
@Override