Adam Murdoch wrote:
On Wed, 18 Dec 2002 01:18 pm, Berin Loritsch wrote:

There are two major differences. There is a new overall phase
(Transition), which means the component can claim or release any
runtime resources that it will need for processing.

Do you mean that initialize() would not be able to look stuff up? Or the component's business methods? Or dispose()?
No, I mean that once a component is in transition, it can be
brought in and out of service at will.  The distinction being that
we want to offer the opportunity for the component to temporarily
unload some runtime data that it doesn't need while it is resting.


We can look at this later, essentially we might be able to merge the
Interuptable and Startable interfaces (only one or the other) if we
have the concept of Transition.


It is also important to note that Initializable/Disposable can only be
called once (each), and Startable can be called any number of times.
Startable.start() brings the component from Transition to Active Use,
and Startable.stop() brings the component from Active Use to Transition.
Once the component has been disposed, can never be brought back to
life.

Why is it useful for a component to be restarted? It's a bunch of extra work for the component writer to make sure that the component can be safely restarted. What benefit do they get out of it?
It's like a J2EE server wanting to temporarily bring a webapp out of
service while the administrator upgrades the files.  When its brought
back up, it has new information.


Getting back to the Serviceable interface, we need to realize that now
it is not just making other components available.  It is also making
the configuration information available.  Below is only one possibility:

interface ServiceManager
{
     Configuration getConfiguration();
     void writeConfiguration(Configuration config)
             throws ServiceUnavailableException;

An alternative to writeConfiguration() or bind( name, config ), would be to return a mutable Configuration.
But how would the container know when it is safe to save it?
The bind/write idiom is well understood, and a whole bunch easier to
tool.

Can we add boolean contains( String urn ) too?
sure.

What goes in the session?
Its something I keep wanting to bring to the table.  The problem the
Session tries to solve is one where pooled components need to keep
conversational state with its clients.  Imagine a system where the
container only provides a proxy or facade to the client.  The container
will reclaim the component after a period of inactivity and allow it
to be used by another client.  The component needs to maintain its
information in something called a Session to keep track of where it
is.  Think of it like HttpServlet session objects--but on a much smaller
scale.

---------------------------------------------
Introducing NetZero Long Distance
1st month Free!
Sign up today at: www.netzerolongdistance.com

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to