org.jboss.dependency.plugins
Class ScopedController

java.lang.Object
  extended by org.jboss.util.JBossObject
      extended by org.jboss.dependency.plugins.AbstractController
          extended by org.jboss.dependency.plugins.ScopedController
All Implemented Interfaces:
Cloneable, Iterable<ControllerState>, AbstractControllerMBean, Controller, ControllerStateModel, GraphController, org.jboss.util.JBossInterface
Direct Known Subclasses:
AbstractKernelController

public abstract class ScopedController
extends AbstractController

Scoped controller. The only scoping logic is local lookup and add/remove of controller context. Subclasses should provide parent lookup after looking at the current scoped instance.

Author:
Ales Justin

Field Summary
 
Fields inherited from class org.jboss.util.JBossObject
hashCode, log, toString
 
Constructor Summary
ScopedController()
           
 
Method Summary
protected  void addControllerContext(ControllerContext context)
          Add controller context.
 ControllerContext getContextLocally(Object name, ControllerState state)
          Get the context only in this scope.
protected  Executor getExecutionEnvironment()
          Get the executor internal w/o security check.
 org.jboss.metadata.spi.scope.ScopeKey getScopeKey()
          Get scope key.
protected  boolean isScoped()
          Is controller scoped.
protected  void preAliasInstall(ControllerContext aliasContext)
          Apply pre install - e.g.
protected  void removeControllerContext(ControllerContext context)
          Remove controller context.
protected  void setScopeKey(org.jboss.metadata.spi.scope.ScopeKey scopeKey)
           
protected  void setUnderlyingController(AbstractController underlyingController)
           
protected  void toString(org.jboss.util.JBossStringBuilder buffer)
          Add scope key info to toString.
 
Methods inherited from class org.jboss.dependency.plugins.AbstractController
addAlias, addCallback, addController, addState, advance, change, change, checkShutdown, createAliasActions, enableOnDemand, enableOnDemand, getAllContexts, getCallbacks, getClassesImplemented, getContext, getContext, getContexts, getContextsByState, getControllers, getDependencyCallbacks, getExecutor, getId, getInstalledContext, getNextState, getNotInstalled, getParentController, getPreviousState, getRegisteredControllerContext, getState, getStateIndex, getStateIndex, getStates, handleInstallLifecycleCallbacks, handleLifecycleCallbacks, handleUninstallLifecycleCallbacks, incrementState, install, install, install, isActive, isAfterState, isBeforeState, isCollectStats, isShutdown, iterator, listIteraror, listStateTimes, lockRead, lockWrite, registerControllerContext, registerControllerContext, removeAlias, removeCallback, removeController, resolveCallbacks, resolveCallbacks, resolveContexts, resolveContexts, resolveContexts, setCollectStats, setExecutor, setParentController, shutdown, traverseClass, uninstall, uninstall, uninstall, uninstallContext, uninstallContext, unlockRead, unlockWrite, unregisterControllerContext, unregisterControllerContext
 
Methods inherited from class org.jboss.util.JBossObject
cacheGetHashCode, cacheToString, clone, equals, flushJBossObjectCache, getClassShortName, getHashCode, hashCode, list, notEqual, toShortString, toShortString, toString, toStringImplementation
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.util.JBossInterface
clone, toShortString, toShortString
 

Constructor Detail

ScopedController

public ScopedController()
Method Detail

getExecutionEnvironment

protected Executor getExecutionEnvironment()
Description copied from class: AbstractController
Get the executor internal w/o security check.

Overrides:
getExecutionEnvironment in class AbstractController
Returns:
the executor

getScopeKey

public org.jboss.metadata.spi.scope.ScopeKey getScopeKey()
Get scope key.

Returns:
the scope key

setScopeKey

protected void setScopeKey(org.jboss.metadata.spi.scope.ScopeKey scopeKey)

setUnderlyingController

protected void setUnderlyingController(AbstractController underlyingController)

preAliasInstall

protected void preAliasInstall(ControllerContext aliasContext)
Description copied from class: AbstractController
Apply pre install - e.g. scope key in scoped controller.

Overrides:
preAliasInstall in class AbstractController
Parameters:
aliasContext - the new alias context

getContextLocally

public ControllerContext getContextLocally(Object name,
                                           ControllerState state)
Get the context only in this scope. No hierarchy lookup.

Parameters:
name - the context name
state - the controller state
Returns:
found context or null if not available

isScoped

protected boolean isScoped()
Is controller scoped.

Returns:
true if scoped

addControllerContext

protected void addControllerContext(ControllerContext context)
Description copied from class: AbstractController
Add controller context. This is normally used when switching from top level controller to a scoped one.

Parameters:
context - the controller context

removeControllerContext

protected void removeControllerContext(ControllerContext context)
Description copied from class: AbstractController
Remove controller context. This is normally used when switching from scoped level controller to a top one.

Parameters:
context - the controller context

toString

protected void toString(org.jboss.util.JBossStringBuilder buffer)
Add scope key info to toString.

Overrides:
toString in class org.jboss.util.JBossObject
Parameters:
buffer - the string buffer


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.