org.jboss.dependency.plugins.graph
Class AbstractLookupStrategy

java.lang.Object
  extended by org.jboss.dependency.plugins.graph.AbstractLookupStrategy
All Implemented Interfaces:
LookupStrategy, SearchInfo
Direct Known Subclasses:
LocalLookupStrategy, ParentLookupStrategy, TopLevelLookupStrategy

public abstract class AbstractLookupStrategy
extends Object
implements LookupStrategy, SearchInfo

Abstract lookup strategy. Only working on AbstractController controller instances.

Author:
Ales Justin

Constructor Summary
protected AbstractLookupStrategy()
           
protected AbstractLookupStrategy(Map<String,?> info)
           
 
Method Summary
 ControllerContext getContext(Controller controller, Object name, ControllerState state)
          Get context based on this strategy.
protected abstract  ControllerContext getContextInternal(AbstractController controller, Object name, ControllerState state)
          Get context based on this strategy.
 Map<String,?> getInfo()
          Get the info.
 LookupStrategy getStrategy()
          Get the lookup strategy.
 String getType()
          The search type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractLookupStrategy

protected AbstractLookupStrategy()

AbstractLookupStrategy

protected AbstractLookupStrategy(Map<String,?> info)
Method Detail

getType

public String getType()
Description copied from interface: SearchInfo
The search type. If there is no supported lookup strategy GraphController implementation might return context on itself.

Specified by:
getType in interface SearchInfo
Returns:
the type

getInfo

public Map<String,?> getInfo()
Description copied from interface: SearchInfo
Get the info. Additional parameters to be used for search.

Specified by:
getInfo in interface SearchInfo
Returns:
the additional info

getStrategy

public LookupStrategy getStrategy()
Description copied from interface: SearchInfo
Get the lookup strategy. Might be null, but then we expect the GraphController to implement this search type. Otherwise error should be thown by GraphController.

Specified by:
getStrategy in interface SearchInfo
Returns:
the strategy or null depending on GraphContorller

getContext

public ControllerContext getContext(Controller controller,
                                    Object name,
                                    ControllerState state)
Description copied from interface: LookupStrategy
Get context based on this strategy.

Specified by:
getContext in interface LookupStrategy
Parameters:
controller - the current controller
name - the name of the context
state - the context's state
Returns:
context or null if not available

getContextInternal

protected abstract ControllerContext getContextInternal(AbstractController controller,
                                                        Object name,
                                                        ControllerState state)
Get context based on this strategy.

Parameters:
controller - the current abstract controller
name - the name of the context
state - the context's state
Returns:
context or null if not available


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