org.jboss.dependency.spi
Interface Controller

All Superinterfaces:
Cloneable, org.jboss.util.JBossInterface
All Known Subinterfaces:
KernelController
All Known Implementing Classes:
AbstractController, AbstractKernelController, ScopedController, ScopedKernelController

public interface Controller
extends org.jboss.util.JBossInterface

A controller.

The controller is the core component for keeping track of contexts to make sure the configuration and lifecycle are done in the correct order including dependencies and classloading considerations.

Version:
$Revision: 71794 $
Author:
Adrian Brock

Method Summary
 void addAlias(Object alias, Object original)
          Add alias.
 void addState(ControllerState state, ControllerState before)
          Add a state.
 void change(ControllerContext context, ControllerState state)
          Change a context to the given state
 void enableOnDemand(ControllerContext context)
          Enable an on demand context
 ControllerContext getContext(Object name, ControllerState state)
          Get a context
 Set<ControllerContext> getContextsByState(ControllerState state)
          Get the contexts in certain state
 ControllerContext getInstalledContext(Object name)
          Get an installed context
 Set<ControllerContext> getNotInstalled()
          Get the contexts not installed
 ControllerStateModel getStates()
          Get the states model.
 void install(ControllerContext context)
          Install a context
 boolean isShutdown()
          Whether the controller is shutdown
 void removeAlias(Object alias)
          Remove alias.
 void shutdown()
          Shutdown the controller
 ControllerContext uninstall(Object name)
          Uninstall a context
 
Methods inherited from interface org.jboss.util.JBossInterface
clone, toShortString, toShortString
 

Method Detail

install

void install(ControllerContext context)
             throws Throwable
Install a context

Parameters:
context - the context
Throws:
Throwable - for any error

change

void change(ControllerContext context,
            ControllerState state)
            throws Throwable
Change a context to the given state

Parameters:
context - the context
state - the state
Throws:
Throwable - for any error

enableOnDemand

void enableOnDemand(ControllerContext context)
                    throws Throwable
Enable an on demand context

Parameters:
context - the context
Throws:
Throwable - for any error

uninstall

ControllerContext uninstall(Object name)
Uninstall a context

Parameters:
name - the name of the component
Returns:
the context

addAlias

void addAlias(Object alias,
              Object original)
              throws Throwable
Add alias.

Parameters:
alias - the alias to add
original - original name
Throws:
Throwable - for any error

removeAlias

void removeAlias(Object alias)
Remove alias.

Parameters:
alias - alias to remove

getContext

ControllerContext getContext(Object name,
                             ControllerState state)
Get a context

Parameters:
name - the name of the component
state - the state (pass null for any state)
Returns:
the context

getInstalledContext

ControllerContext getInstalledContext(Object name)
Get an installed context

Parameters:
name - the name of the component
Returns:
the context

getNotInstalled

Set<ControllerContext> getNotInstalled()
Get the contexts not installed

Returns:
Set

addState

void addState(ControllerState state,
              ControllerState before)
Add a state.

Parameters:
state - the state to add
before - the state to add before or null to add to the end

getStates

ControllerStateModel getStates()
Get the states model.

Returns:
the states in order

getContextsByState

Set<ControllerContext> getContextsByState(ControllerState state)
Get the contexts in certain state

Parameters:
state - controller state to get contexts for
Returns:
set of contexts in certain state

isShutdown

boolean isShutdown()
Whether the controller is shutdown

Returns:
true when shutdown

shutdown

void shutdown()
Shutdown the controller



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