com.guiseframework
Class GuiseSessionThreadGroup

java.lang.Object
  extended by java.lang.ThreadGroup
      extended by com.guiseframework.GuiseSessionThreadGroup
All Implemented Interfaces:
com.globalmentor.config.ConfigurationManaged, java.lang.Thread.UncaughtExceptionHandler

public class GuiseSessionThreadGroup
extends java.lang.ThreadGroup
implements com.globalmentor.config.ConfigurationManaged

A thread group allocated to a Guise session. All threads accessing a Guise session should be part of the session's thread group.

This thread group also allows access to managed configurations using Configurator. Thread-group-local configurations are retrieved by searching for a configuration first in the Guise session using ConfigurationManaged.getConfiguration(Class), and second in the Guise application using ConfigurationManaged.getConfiguration(Class).

Author:
Garret Wilson

Constructor Summary
GuiseSessionThreadGroup(GuiseSession guiseSession)
          Guise session constructor.
 
Method Summary
<C extends com.globalmentor.config.Configuration>
C
getConfiguration(java.lang.Class<C> configurationClass)
          Returns the configuration for the given configuration type.
 GuiseSession getGuiseSession()
          The Guise session to which this thread group belongs and in which its related threads run.
 
Methods inherited from class java.lang.ThreadGroup
activeCount, activeGroupCount, allowThreadSuspension, checkAccess, destroy, enumerate, enumerate, enumerate, enumerate, getMaxPriority, getName, getParent, interrupt, isDaemon, isDestroyed, list, parentOf, resume, setDaemon, setMaxPriority, stop, suspend, toString, uncaughtException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GuiseSessionThreadGroup

public GuiseSessionThreadGroup(GuiseSession guiseSession)
Guise session constructor.

Parameters:
guiseSession - The Guise session to which this thread group belongs and in which its related threads run.
Throws:
java.lang.NullPointerException - if the given Guise session is null.
Method Detail

getGuiseSession

public GuiseSession getGuiseSession()
The Guise session to which this thread group belongs and in which its related threads run.


getConfiguration

public <C extends com.globalmentor.config.Configuration> C getConfiguration(java.lang.Class<C> configurationClass)
Returns the configuration for the given configuration type.

Specified by:
getConfiguration in interface com.globalmentor.config.ConfigurationManaged
Type Parameters:
C - The type of configuration to retrieve.
Parameters:
configurationClass - The class of configuration to retrieve.
Returns:
The configuration associated with the given class, or null if there was no configuration for that class.


Copyright © 2005-2010 GlobalMentor, Inc. All Rights Reserved.