deltaspike-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gerhard Petracek <gerhard.petra...@gmail.com>
Subject Re: [DISCUSS] start()/boot() vs stop()/shutdown()
Date Mon, 19 Mar 2012 12:12:25 GMT
hi mark,

that means you have to write 4 lines in >several< (for sure not all) cases,
but you can do the same with 2 lines (with the convenience methods).
if there was confusion about the previous convenience methods (i can't see
it in the archive), it's just a matter of documentation (= one line of
javadoc).
at least we have to discuss it (instead of removing an existing api
"silently").

if we can't agree on such convenience methods, we have to merge the
shutdown logic. right now it's too error prone (see [1]).

regards,
gerhard

[1] https://issues.apache.org/jira/browse/DELTASPIKE-124

http://www.irian.at

Your JSF/JavaEE powerhouse -
JavaEE Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces



2012/3/19 Mark Struberg <struberg@yahoo.de>

> Hi!
>
> This is related to
>
> https://issues.apache.org/jira/browse/DELTASPIKE-123
>
> We had this discussion on the list and I already got lots of questions why
> we have those 'duplicated functions'.
> In fact I had to explain the differences a few times already thus I
> decided to drop the start() and stop() methods and make the ContextControl
> easily accessible from the CdiContainer interface.
>
> The current functionality is the following:
> * boot() will just boot the CDI container (Weld or OWB) and _not_ start
> any Contexts. We don't do this implicitly because we might not have all the
> information. Of course this will have much more impact once we also
> implemented not only the startContext() and stopContext() in the
> ContextControl API but also added more information about e.g. sessionId,
> etc.
>
>
> Especially if CDI is used in JavaSE we simply don't know _which_ Contexts
> are going to be used or if any of the built-in contexts is being used at
> all. In Java SE it could be possible that the whole app just uses custom
> scopes only!
>
> Thus your code will always look like the following
> > CdiContainer cdiCtr = CdiContainerLoader.getCdiContainer();
> > cdiCtr.boot();
>
> +
>
> > cdiCtr.getContextControl(). ... start whatever builtin Context you need.
>
> Really, the use case that you like to start ALL Contexts is _not_ the
> default!
>
>
> Of course
> CdiContainer#shutdown() should also close all open built-in Contexts
> properly (We should add this to the JavaDoc).
>
> Btw, I now used boot() and shutdown() because this is d'accord with the
> CDI specification (@Observes BeforeShutdown)
>
>
> Hope this helps understanding the situation.
>
>
>
> Any objections?
>
>
> LieGrue,
> strub
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message