<br><font size=1 face="sans-serif"><b>Bryan Atsatt &lt;bryan.atsatt@ORACLE.COM&gt;</b></font><tt><font size=2>
wrote on 25/06/2007 06:00:12 PM:<br>
<br>
&gt; It seems simple enough to put the module in a failed state if a<br>
&gt; module-init event handler throws an exception. Is this not sufficient?</font></tt>
<br>
<br><tt><font size=2>No, I don't think so.</font></tt>
<br>
<br><tt><font size=2>What state would a module be in when its module-init
event is published? If potential consumers of the module listen for the
event, then they'll be interested in the module being initialised (ideally
meaning its activator has already completed successfully) and ready for
use. But the module can't be in the initalised state if it might transition
to a failed state if one of the event handlers calls the module's activator
and that fails.</font></tt>
<br>
<br><tt><font size=2>Also, why should the failure of a 3rd party listener
put the module in a failed state? One buggy or malicious module could impact
the whole system.</font></tt>
<br><tt><font size=2><br>
&gt; <br>
&gt; The lazy init feature sounds like a nice optimization, but doesn't<br>
&gt; strike me as a must-have. Have you seen use-cases that require it?
Are<br>
&gt; they init order issues?</font></tt>
<br>
<br><tt><font size=2>I agree it's not a must have as JSR 291 handles that.</font></tt>
<br><tt><font size=2><br>
&gt; <br>
&gt; <br>
&gt; (I am sensitive to your meta point here, but... If 277 is going to<br>
&gt; exist, there are some rather obvious, desirable features which it
will<br>
&gt; need, just as OSGi needed them. I _don't_ like the fact that we are<br>
&gt; re-inventing rather than re-using OSGi, but that is how it has played<br>
&gt; out, despite all protestations. As long as we can still attain the
goal<br>
&gt; of meaningful interoperation, it seems irresponsible to leave out<br>
&gt; features like this. And yes, we must nail down the interoperation
model<br>
&gt; before we go much/any farther.)</font></tt>
<br>
<br><tt><font size=2>We *have* to find some way of JSR 277 being able to
'delegate' some responsibilities to JSR 291 rather than having to reproduce
the whole shooting match which would literally take years (to produce something
as good). I'd like to see JSR 277 providing some kind of basic support
-- at least the repository -- with JSR 291 providing the bells and whistles.</font></tt>
<br>
<br><tt><font size=2>Glyn</font></tt>
<br><tt><font size=2><br>
&gt; <br>
&gt; Glyn Normington wrote:<br>
&gt; &gt;<br>
&gt; &gt; Yes, but my point was that separating lifecycle out in that way
would<br>
&gt; &gt; make it harder to enforce constraints like &quot;if a module's
state is<br>
&gt; &gt; initialised, the module's activator completed successfully&quot;.<br>
&gt; &gt;<br>
&gt; &gt; JSR 291 solved this problem with additional module states and
error<br>
&gt; &gt; handling. It also supports lazy module initialisation triggered
by the<br>
&gt; &gt; first class load from a module. How much of this should JSR 277
re-invent?<br>
&gt; &gt;<br>
&gt; &gt; Glyn<br>
&gt; &gt;<br>
&gt; &gt; *Bryan Atsatt &lt;bryan.atsatt@ORACLE.COM&gt;* wrote on 22/06/2007
06:12:48 PM:<br>
&gt; &gt;<br>
&gt; &gt; &nbsp;&gt; I think that is part of Stanley's point here: the
module system isn't<br>
&gt; &gt; &nbsp;&gt; responsible, as it merely generates the events. Some
*other* system<br>
&gt; &gt; &nbsp;&gt; could then take on lifecycle based on these events.<br>
&gt; &gt; &nbsp;&gt;<br>
&gt; &gt; &nbsp;&gt; Glyn Normington wrote:<br>
&gt; &gt; &nbsp;&gt; &gt;<br>
&gt; &gt; &nbsp;&gt; &gt; Hmmm. I thought so too (apart from reinventing
the OSGi lifecycle<br>
&gt; &gt; event,<br>
&gt; &gt; &nbsp;&gt; &gt; of course), but I wonder if the module system
needs to be directly<br>
&gt; &gt; &nbsp;&gt; &gt; responsible for driving an activator in case
it fails to terminate (in<br>
&gt; &gt; &nbsp;&gt; &gt; which case the module needs to enter some kind
of error or inactive<br>
&gt; &gt; state)?<br>
&gt; &gt; &nbsp;&gt; &gt;<br>
&gt; &gt; &nbsp;&gt; &gt; Glyn<br>
&gt; &gt; &nbsp;&gt; &gt;<br>
&gt; &gt; &nbsp;&gt; &gt; *&quot;Richard S. Hall&quot; &lt;heavy@UNGOVERNED.ORG&gt;*
wrote on 22/06/2007<br>
&gt; &gt; 01:21:48 PM:<br>
&gt; &gt; &nbsp;&gt; &gt;<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; I think your suggestion is reasonable.<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt;<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; -&gt; richard<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt;<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; Stanley M. Ho wrote:<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; Hi JSR 277 experts,<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt;<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; Since we have been discussing
some issues around the module<br>
&gt; &gt; instances'<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; lifetime lately, I think it's
probably a good time to bring up a<br>
&gt; &gt; &nbsp;&gt; &gt; related<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; topic for discussion.<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt;<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; As I reviewed the feedbacks from
the EDR comments, from our<br>
&gt; &gt; previous<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; discussions, as well as from
my discussions with the teams in SE<br>
&gt; &gt; &nbsp;&gt; &gt; and EE,<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; there were a few suggestions
related to the module<br>
&gt; &gt; instances'lifetime:<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt;<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; 1. The module system shall provide
a way to monitor various<br>
&gt; &gt; events,<br>
&gt; &gt; &nbsp;&gt; &gt; e.g.<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; module initialized, module released,
etc.<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; 2. The module system shall allow
a module to have activator<br>
&gt; &gt; code. The<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; activator code would be executed
right before the module is fully<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; initialized and when the instance
is released.<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; 3. A module shall have a way
to be stopped.<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt;<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; Having these suggestions don't
mean we have to do all of them,<br>
&gt; &gt; and I<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; would like to get your inputs.<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt;<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt;<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; From my perspective, having a
way to monitor module system's<br>
&gt; &gt; events<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; (i.e. #1) seems very reasonable
and useful, especially the use<br>
&gt; &gt; &nbsp;&gt; &gt; cases are<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; very common. In fact, many teams
in SE have expressed the needs in<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; monitoring the module system's
events in their class libraries<br>
&gt; &gt; in some<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; degrees, so these libraries would
react and behave<br>
&gt; &gt; appropriately. There<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; are also other class libraries
sitting on top of the JREthat have<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; similar needs.<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt;<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; For #2, this is a use case I
gathered from EE, and this would<br>
&gt; &gt; be used<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; mainly for registering and unregistering
services when a<br>
&gt; &gt; module has<br>
&gt; &gt; &nbsp;&gt; &gt; been<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; initialized or is released. Not
that I think this is<br>
&gt; &gt; unimportant, but I<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; am not yet convinced this is
something we need to support<br>
&gt; &gt; directly at<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; the module system level. For
instance, if the module system<br>
&gt; &gt; &nbsp;&gt; &gt; notification<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; mechanism (i.e. #1) is available,
it should be possible for the EE<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; server (or other apps that require
similar functionality) to<br>
&gt; &gt; build a<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; simple activator layer on top
of the module system.<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt;<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; For #3, the use case is that
some EE servers might want to<br>
&gt; &gt; have the<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; ability to &quot;stop&quot; a
module by disabling the module's<br>
&gt; &gt; classloader when<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; the module instance is released.
In general, disabling a<br>
&gt; &gt; classloader is<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; an uncommon and dangerous operation
to perform, and it also<br>
&gt; &gt; &nbsp;&gt; &gt; violates the<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; current classloading spec. While
I agreed we should make this<br>
&gt; &gt; use case<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; possible, I don't think this
is something we want to push into the<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; module system.; I believe there
are alternatives we could<br>
&gt; &gt; consider to<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; achieve the same result. For
example, suppose there are APIs<br>
&gt; &gt; available<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; to disable a classloader (might
come from the classloading<br>
&gt; &gt; project) and<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; the module system notification
mechanism (i.e. #1) is<br>
&gt; &gt; available, it<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; should be possible for the EE
servers to hook into the<br>
&gt; &gt; notification<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; mechanism, and disable the specific
classloader it wants when<br>
&gt; &gt; a module<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; instance is released from the
module system.<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt;<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt;<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; To keep things simple, I suggest
we should support #1, and I<br>
&gt; &gt; hope this<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; should be sufficient to enable
other applications (e.g. EE<br>
&gt; &gt; servers) to<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; support #2 and #3. I would like
to hear what your thoughts are.<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt;<br>
&gt; &gt; &nbsp;&gt; &gt; &nbsp;&gt; &gt; - Stanley<br>
&gt; &gt; &nbsp;&gt; &gt;<br>
&gt; &gt; &nbsp;&gt; &gt;<br>
&gt; &gt; &nbsp;&gt; &gt;<br>
&gt; &gt; &nbsp;&gt; &gt;<br>
&gt; &gt; ------------------------------------------------------------------------<br>
&gt; &gt; &nbsp;&gt; &gt;<br>
&gt; &gt; &nbsp;&gt; &gt; /<br>
&gt; &gt; &nbsp;&gt; &gt; /<br>
&gt; &gt; &nbsp;&gt; &gt;<br>
&gt; &gt; &nbsp;&gt; &gt; /Unless stated otherwise above:<br>
&gt; &gt; &nbsp;&gt; &gt; IBM United Kingdom Limited - Registered in England
and Wales with<br>
&gt; &gt; number<br>
&gt; &gt; &nbsp;&gt; &gt; 741598.<br>
&gt; &gt; &nbsp;&gt; &gt; Registered office: PO Box 41, North Harbour,
Portsmouth, Hampshire<br>
&gt; &gt; PO6 3AU/<br>
&gt; &gt; &nbsp;&gt; &gt;<br>
&gt; &gt; &nbsp;&gt; &gt;<br>
&gt; &gt; &nbsp;&gt; &gt;<br>
&gt; &gt; &nbsp;&gt; &gt;<br>
&gt; &gt; &nbsp;&gt; &gt;<br>
&gt; &gt; &nbsp;&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; ------------------------------------------------------------------------<br>
&gt; &gt;<br>
&gt; &gt; /<br>
&gt; &gt; /<br>
&gt; &gt;<br>
&gt; &gt; /Unless stated otherwise above:<br>
&gt; &gt; IBM United Kingdom Limited - Registered in England and Wales
with number<br>
&gt; &gt; 741598.<br>
&gt; &gt; Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire
PO6 3AU/<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
</font></tt><font size=3 face="sans-serif"><br>
</font>
<br><font size=3 face="sans-serif"><br>
</font>
<hr><font size=2 face="sans-serif"><br>
<i><br>
</i></font>
<p><font size=2 face="sans-serif"><i>Unless stated otherwise above:<br>
IBM United Kingdom Limited - Registered in England and Wales with number
741598. <br>
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6
3AU</i></font>
<p><font size=2 face="sans-serif"><br>
</font><font size=3 face="sans-serif"><br>
</font>
<br>
<br><font size=3 face="sans-serif"><br>
</font>