SmartFrog 3.10.000

org.smartfrog.sfcore.reference
Interface ReferenceResolver

All Known Subinterfaces:
ComponentDescription, CSFComponentDescription, Phases, SFComponentDescription
All Known Implementing Classes:
ComponentDescriptionImpl, CSFComponentDescriptionImpl, SFComponentDescriptionImpl

public interface ReferenceResolver

Defines reference resolving. It abstracts the target of the resolution so references do not need to know about it. This way, implementations can also decide the mechanism used to resolve each part. An example of a difference resolver would be one that walks a directory service, or a web server to locate the reference. ReferenceParts will call back to resolve themselves, causing the reference resolver to forward the rest of the resolution to the next component.


Method Summary
 java.lang.Object sfResolve(Reference r)
          Resolve a given reference.
 java.lang.Object sfResolve(Reference reference, int index)
          Resolves a reference starting at a given index.
 java.lang.Object sfResolveHere(java.lang.Object name)
          Find an attribute in this context.
 java.lang.Object sfResolveHere(java.lang.Object name, boolean mandatory)
          Find an attribute in this context.
 java.lang.Object sfResolveParent()
          Call in to resolve to the parent reference resolver of this one.
 

Method Detail

sfResolve

java.lang.Object sfResolve(Reference r)
                           throws SmartFrogResolutionException
Resolve a given reference. Generally forwards directly to indexed resolve with index 0

Parameters:
r - reference to resolve
Returns:
resolved reference
Throws:
SmartFrogResolutionException - if error occurred while resolving

sfResolve

java.lang.Object sfResolve(Reference reference,
                           int index)
                           throws SmartFrogResolutionException
Resolves a reference starting at a given index.

Parameters:
reference - reference to be resolved
index - starting index
Returns:
Object attribute at resolved reference
Throws:
SmartFrogResolutionException - if error occurred while resolving

sfResolveParent

java.lang.Object sfResolveParent()
                                 throws SmartFrogResolutionException
Call in to resolve to the parent reference resolver of this one.

Returns:
parent referencee resolver or null if none
Throws:
SmartFrogResolutionException - if error occurred while resolving

sfResolveHere

java.lang.Object sfResolveHere(java.lang.Object name)
                               throws SmartFrogResolutionException
Find an attribute in this context.

Parameters:
name - attribute key to resolve
Returns:
resolved attribute
Throws:
SmartFrogResolutionException - failed to find attribute

sfResolveHere

java.lang.Object sfResolveHere(java.lang.Object name,
                               boolean mandatory)
                               throws SmartFrogResolutionException
Find an attribute in this context.

Parameters:
name - attribute key to resolve
mandatory - boolean that indicates if this attribute must be present in the description. If it is mandatory and not found it throws a SmartFrogResolutionException
Returns:
Object value for attribute
Throws:
SmartFrogResolutionException - failed to find attribute

SmartFrog CORE 3.10.000

(C) Copyright 1998-2006 Hewlett-Packard Development Company, LP