net.sourceforge.basher.impl
Class ContextManagerImpl

java.lang.Object
  extended by net.sourceforge.basher.impl.ContextManagerImpl
All Implemented Interfaces:
EventListener, ContextManager, BasherEventListener

public class ContextManagerImpl
extends Object
implements ContextManager, BasherEventListener

Version:
$Revision$
Author:
Johan Lindquist

Field Summary
 
Fields inherited from interface net.sourceforge.basher.ContextManager
DEFAULT_BASHER_CONTEXT_NAME
 
Constructor Summary
ContextManagerImpl()
           
 
Method Summary
 void addBasherContext(BasherContext basherContext)
          Adds the specified context to the system.
 void basherEvent(BasherEvent basherEvent)
           
 BasherContext getActiveBasherContext()
          Retrieves the currently active context.
 BasherContext getBasherContext(String contextName)
          Retrieves the by name specified context.
 List<BasherContext> getBasherContexts()
          Retrieves the list of all registered contexts.
 void setActiveBasherContext(BasherContext basherContext)
          Sets the specified context to be the active, used context.
 void setBasherContexts(List<BasherContext> basherContexts)
          Sets the list of available SystemContexts.
 void setLog(org.apache.commons.logging.Log log)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextManagerImpl

public ContextManagerImpl()
Method Detail

getActiveBasherContext

public BasherContext getActiveBasherContext()
Retrieves the currently active context.

Specified by:
getActiveBasherContext in interface ContextManager
Returns:
The active context

setActiveBasherContext

public void setActiveBasherContext(BasherContext basherContext)
Sets the specified context to be the active, used context.

Specified by:
setActiveBasherContext in interface ContextManager
Parameters:
basherContext - The context to activate.

getBasherContext

public BasherContext getBasherContext(String contextName)
Description copied from interface: ContextManager
Retrieves the by name specified context.

Specified by:
getBasherContext in interface ContextManager
Parameters:
contextName - The name of the context to retrieve.
Returns:
The specified context or null if not present.

getBasherContexts

public List<BasherContext> getBasherContexts()
Retrieves the list of all registered contexts.

Specified by:
getBasherContexts in interface ContextManager
Returns:
The list of contexts available.

addBasherContext

public void addBasherContext(BasherContext basherContext)
Adds the specified context to the system.

Specified by:
addBasherContext in interface ContextManager
Parameters:
basherContext - The context to add.

setBasherContexts

public void setBasherContexts(List<BasherContext> basherContexts)
Sets the list of available SystemContexts. The specified list will be added the list of already present contexts if any.

Parameters:
basherContexts - The list of avialable system contexts.

setLog

public void setLog(org.apache.commons.logging.Log log)

basherEvent

public void basherEvent(BasherEvent basherEvent)
Specified by:
basherEvent in interface BasherEventListener


Copyright © 2006-2010 Basher Team. All Rights Reserved.