avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Neeme Praks <ne...@apache.org>
Subject Re: Context: usage recommendations? ( Re: [SUMMARY] Context )
Date Tue, 03 Dec 2002 11:56:18 GMT


Stephen McConnell ::

> One or more component authors (like those James guys) - let's imagine
> they want to lock a component into a suiside pact and as such - their
> component needs a shutdown service.  When the component hits
> requestShutdown() their component is going die - ok, that's cool -
> perhaps the component is running under the mailet API and what it really
> needs is a reserection (but that's a thread for next year) - aside from
> that - problem is their component needs to be able to say "I need to
> make request to the thing that started me up in the first place".  This
> is not the same semantics as a classic lookup() or get().  The issue -
> how can we convey that notion that the component is requesting a service
> from a provider that it intrisic to its own existance - that's what I'm
> trying to distinguish here - the notion of a privaliged request. Its
> priviliged if it's from sibling to parent.  A shutdown request is one
> example, other examples include notification of state change, request
> for re-deployment etc.


I'm not really fond of the distinction between priviledged and 
non-priviledged services...
How about then one more (optional) "lifescycle extension", e.g:

public interface Child {

     void setParent(Parent parent);

}

And then this "parent" object would follow the same semantics as has 
been proposed for Context:

ShutDownableParent shutDownableParent = (ShutDownableParent) 
parent.getInterface(ShutDownableParent.class);
shutDownableParent.requestShutdown();

(or whatever flavour of the extended context methods you prefer)

Or am I totally wandering in the dark here...

Rgds,
Neeme




--
To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>


Mime
View raw message