org.jboss.dependency.plugins
Class AbstractControllerContext

java.lang.Object
  extended by org.jboss.util.JBossObject
      extended by org.jboss.dependency.plugins.AbstractControllerContext
All Implemented Interfaces:
Cloneable, ControllerContext, org.jboss.util.JBossInterface
Direct Known Subclasses:
AbstractAliasControllerContext, AbstractKernelControllerContext

public class AbstractControllerContext
extends org.jboss.util.JBossObject
implements ControllerContext

A ControllerContext.

Version:
$Revision: 71354 $
Author:
Adrian Brock

Field Summary
 
Fields inherited from class org.jboss.util.JBossObject
hashCode, log, toString
 
Constructor Summary
AbstractControllerContext(Object name, ControllerContextActions actions)
          Create a new AbstractControllerContext.
AbstractControllerContext(Object name, ControllerContextActions actions, DependencyInfo dependencies)
          Create a new AbstractControllerContext.
AbstractControllerContext(Object name, ControllerContextActions actions, DependencyInfo dependencies, Object target)
          Create a new AbstractControllerContext.
AbstractControllerContext(Object name, Object target)
          Create a new AbstractControllerContext.
AbstractControllerContext(Object name, Set<Object> aliases, ControllerContextActions actions, DependencyInfo dependencies, Object target)
          Create a new AbstractControllerContext.
 
Method Summary
 Set<Object> getAliases()
          The aliases
 Controller getController()
          Get the controller
 DependencyInfo getDependencyInfo()
          Get the dependency information
 Throwable getError()
          Get the error
 ErrorHandlingMode getErrorHandlingMode()
          Get the error handling mode.
 ControllerMode getMode()
          Get the mode
 Object getName()
          Get the name
 ControllerState getRequiredState()
          Get the required state
 ScopeInfo getScopeInfo()
          Get the scope information
 ControllerState getState()
          Get the state
 Object getTarget()
          Get any target
protected  void initScopeInfo()
          Initialise the scope info
 void install(ControllerState fromState, ControllerState toState)
          Install
protected  Object needsAnAlias(Object original)
          Whether the given name needs an alias
 void setAliases(Set<Object> aliases)
          Set the aliases
 void setController(Controller controller)
          Set the controller
 void setError(Throwable error)
          Set the error
 void setErrorHandlingMode(ErrorHandlingMode errorHandlingMode)
          Set the error handling mode.
 void setMode(ControllerMode mode)
          Set the mode
 void setName(Object name)
          Set the name
 void setRequiredState(ControllerState state)
          Set the required state
 void setScopeInfo(ScopeInfo scopeInfo)
          Set the scopeInfo.
 void setState(ControllerState state)
          Set the state
 void setTarget(Object target)
          Set the target
 void toShortString(org.jboss.util.JBossStringBuilder buffer)
           
 void toString(org.jboss.util.JBossStringBuilder buffer)
           
 void uninstall(ControllerState fromState, ControllerState toState)
          Uninstall
 
Methods inherited from class org.jboss.util.JBossObject
cacheGetHashCode, cacheToString, clone, equals, flushJBossObjectCache, getClassShortName, getHashCode, hashCode, list, notEqual, 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
 

Constructor Detail

AbstractControllerContext

public AbstractControllerContext(Object name,
                                 ControllerContextActions actions)
Create a new AbstractControllerContext.

Parameters:
name - the name
actions - the actions

AbstractControllerContext

public AbstractControllerContext(Object name,
                                 ControllerContextActions actions,
                                 DependencyInfo dependencies)
Create a new AbstractControllerContext.

Parameters:
name - the name
actions - the actions
dependencies - the dependencies

AbstractControllerContext

public AbstractControllerContext(Object name,
                                 ControllerContextActions actions,
                                 DependencyInfo dependencies,
                                 Object target)
Create a new AbstractControllerContext.

Parameters:
name - the name
actions - the actions
dependencies - the dependencies
target - the target

AbstractControllerContext

public AbstractControllerContext(Object name,
                                 Set<Object> aliases,
                                 ControllerContextActions actions,
                                 DependencyInfo dependencies,
                                 Object target)
Create a new AbstractControllerContext.

Parameters:
name - the name
aliases - the aliases
actions - the actions
dependencies - the dependencies
target - the target

AbstractControllerContext

public AbstractControllerContext(Object name,
                                 Object target)
Create a new AbstractControllerContext.

Parameters:
name - the name
target - the target
Method Detail

getName

public Object getName()
Description copied from interface: ControllerContext
Get the name

Specified by:
getName in interface ControllerContext
Returns:
the name

setName

public void setName(Object name)
Set the name

Parameters:
name - the name

getAliases

public Set<Object> getAliases()
Description copied from interface: ControllerContext
The aliases

Specified by:
getAliases in interface ControllerContext
Returns:
the aliases or null if there are no aliases

setAliases

public void setAliases(Set<Object> aliases)
Set the aliases

Aliases in this list only take effect if they are set before installation on the controller

Parameters:
aliases - the aliases

getState

public ControllerState getState()
Description copied from interface: ControllerContext
Get the state

Specified by:
getState in interface ControllerContext
Returns:
the state

getRequiredState

public ControllerState getRequiredState()
Description copied from interface: ControllerContext
Get the required state

Specified by:
getRequiredState in interface ControllerContext
Returns:
the required state

setRequiredState

public void setRequiredState(ControllerState state)
Description copied from interface: ControllerContext
Set the required state

Specified by:
setRequiredState in interface ControllerContext
Parameters:
state - the required state

getMode

public ControllerMode getMode()
Description copied from interface: ControllerContext
Get the mode

Specified by:
getMode in interface ControllerContext
Returns:
the mode

setMode

public void setMode(ControllerMode mode)
Description copied from interface: ControllerContext
Set the mode

Specified by:
setMode in interface ControllerContext
Parameters:
mode - the mode

getErrorHandlingMode

public ErrorHandlingMode getErrorHandlingMode()
Description copied from interface: ControllerContext
Get the error handling mode.

Specified by:
getErrorHandlingMode in interface ControllerContext
Returns:
the error handling mode

setErrorHandlingMode

public void setErrorHandlingMode(ErrorHandlingMode errorHandlingMode)
Set the error handling mode.

Parameters:
errorHandlingMode - the error handling mode

getController

public Controller getController()
Description copied from interface: ControllerContext
Get the controller

Specified by:
getController in interface ControllerContext
Returns:
the controller

setController

public void setController(Controller controller)
Description copied from interface: ControllerContext
Set the controller

Specified by:
setController in interface ControllerContext
Parameters:
controller - the controller

getDependencyInfo

public DependencyInfo getDependencyInfo()
Description copied from interface: ControllerContext
Get the dependency information

Specified by:
getDependencyInfo in interface ControllerContext
Returns:
the dependency information

getScopeInfo

public ScopeInfo getScopeInfo()
Description copied from interface: ControllerContext
Get the scope information

Specified by:
getScopeInfo in interface ControllerContext
Returns:
the scope information

setScopeInfo

public void setScopeInfo(ScopeInfo scopeInfo)
Set the scopeInfo.

Parameters:
scopeInfo - the scopeInfo.

getTarget

public Object getTarget()
Description copied from interface: ControllerContext
Get any target

Specified by:
getTarget in interface ControllerContext
Returns:
the target

setTarget

public void setTarget(Object target)
Set the target

Parameters:
target - the target

getError

public Throwable getError()
Description copied from interface: ControllerContext
Get the error

Specified by:
getError in interface ControllerContext
Returns:
the error

setError

public void setError(Throwable error)
Description copied from interface: ControllerContext
Set the error

Specified by:
setError in interface ControllerContext
Parameters:
error - the error

setState

public void setState(ControllerState state)
Description copied from interface: ControllerContext
Set the state

Specified by:
setState in interface ControllerContext
Parameters:
state - the state

install

public void install(ControllerState fromState,
                    ControllerState toState)
             throws Throwable
Description copied from interface: ControllerContext
Install

Specified by:
install in interface ControllerContext
Parameters:
fromState - the old state
toState - the new state
Throws:
Throwable - for any error

uninstall

public void uninstall(ControllerState fromState,
                      ControllerState toState)
Description copied from interface: ControllerContext
Uninstall

Specified by:
uninstall in interface ControllerContext
Parameters:
fromState - the old state
toState - the new state

toString

public void toString(org.jboss.util.JBossStringBuilder buffer)
Overrides:
toString in class org.jboss.util.JBossObject

toShortString

public void toShortString(org.jboss.util.JBossStringBuilder buffer)
Specified by:
toShortString in interface org.jboss.util.JBossInterface
Overrides:
toShortString in class org.jboss.util.JBossObject

initScopeInfo

protected void initScopeInfo()
Initialise the scope info


needsAnAlias

protected Object needsAnAlias(Object original)
Whether the given name needs an alias

By default we just add aliases for JMX like ObjectNames to have a canonical name alias

Parameters:
original - the original name
Returns:
the alias if required or null if no alias required


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