+1 Works for me
On Wed, 3 Oct 2001 02:42, Berin Loritsch wrote:
> Currently, Avalon Framework identifies a Resolvable interface
> in the context directory that insinuates that should an object
> use this interface, it will be automatically resolved via the
> Context.
>
> I propose that we modify DefaultContext to check to see if
> the object stored in the Context is Resolveable, and if so
> return the object derived from Resolveable.resolve(Context).
>
> The DefaultContext method in question will change to this:
>
> /**
> * Retrieve an item from the Context.
> *
> * @param key the key of item
> * @return the item stored in context
> * @exception ContextException if item not present
> */
> public Object get( final Object key )
> throws ContextException
> {
> final Object data = m_contextData.get( key );
>
> if( null != data )
> {
> // BEGIN NEW SECTION
>
> if ( data instanceof Resolveable )
> {
> return ( (Resolveable) data ).resolve(this);
> }
>
> // END NEW SECTION
>
> return data;
> }
>
> //thus data == null
> if( null == m_parent )
> {
> throw new ContextException( "Unable to locate " + key );
> }
>
> return m_parent.get( key );
> }
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--
Cheers,
Pete
*--------------------------------*
| Every rule has an exception, |
| except the rule of exceptions. |
*--------------------------------*
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]