Details

      Description

      Weld and other CDI impls allow an embedded mode.

      See http://docs.jboss.org/weld/reference/latest/en-US/html/environments.html#d0e5417 for example

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            meetoblivion John Ament added a comment -

            We're speaking through this again on the 2.0 EG.

            The current proposal is to add a new interface (tentatively called CDIContainer ) which will handle the creation of the container.

            The possible package is javax.enterprise.inject.spi or javax.enterprise.inject.spi.container or something else.

            It's expected to have 2 or 3 methods in it

            init();
             
            init(Map<?,?> params);
             
            shutdown();
            

            Show
            meetoblivion John Ament added a comment - We're speaking through this again on the 2.0 EG. The current proposal is to add a new interface (tentatively called CDIContainer ) which will handle the creation of the container. The possible package is javax.enterprise.inject.spi or javax.enterprise.inject.spi.container or something else. It's expected to have 2 or 3 methods in it init();   init(Map<?,?> params);   shutdown();
            Hide
            jharting Jozef Hartinger added a comment -

            An alternative proposal that does not prevent parallel container instances:

            public abstract class ControlledCDI<T> extends CDI<T> implements AutoCloseable {
             
                public static ControlledCDI<Object> initialize() {
                    // TODO: Use CDIProvider internally to talk to the impl
                }
             
                public static ControlledCDI<Object> initialize(Map<String, Object> properties) {
                    // TODO: Use CDIProvider internally to talk to the impl
                }
             
                public abstract void close();
            }
            

            Usage:

                    try (ControlledCDI<Object> cdi = ControlledCDI.initialize()) {
                        Foo foo = cdi.select(Foo.class).get();
                        System.out.println(foo.computeResult());
                    }
            

            Note that this is a preliminary proposal. The class name is subject to change plus we'll most likely need a builder API instead of the static methods in the end.

            Show
            jharting Jozef Hartinger added a comment - An alternative proposal that does not prevent parallel container instances: public abstract class ControlledCDI<T> extends CDI<T> implements AutoCloseable {   public static ControlledCDI<Object> initialize() { // TODO: Use CDIProvider internally to talk to the impl }   public static ControlledCDI<Object> initialize(Map<String, Object> properties) { // TODO: Use CDIProvider internally to talk to the impl }   public abstract void close(); } Usage: try (ControlledCDI<Object> cdi = ControlledCDI.initialize()) { Foo foo = cdi.select(Foo. class ).get(); System.out.println(foo.computeResult()); } Note that this is a preliminary proposal. The class name is subject to change plus we'll most likely need a builder API instead of the static methods in the end.
            Hide
            antoinesabot-durand Antoine Sabot-Durand added a comment - - edited

            Class scanning and context control will be addressed in other tickets : CDI-529 and CDI-530

            Show
            antoinesabot-durand Antoine Sabot-Durand added a comment - - edited Class scanning and context control will be addressed in other tickets : CDI-529 and CDI-530
            Hide
            antoinesabot-durand Antoine Sabot-Durand added a comment -

            We have overlooked an issue regarding multiple container support.
            http://cdi-development-mailing-list.1064426.n5.nabble.com/It-seems-we-missed-a-point-in-CDIProvider-enhancement-tt5711451.html.
            Correction for EDR1 or enhance proposal should be done to address this point.

            Show
            antoinesabot-durand Antoine Sabot-Durand added a comment - We have overlooked an issue regarding multiple container support. http://cdi-development-mailing-list.1064426.n5.nabble.com/It-seems-we-missed-a-point-in-CDIProvider-enhancement-tt5711451.html . Correction for EDR1 or enhance proposal should be done to address this point.
            Hide
            antoinesabot-durand Antoine Sabot-Durand added a comment -

            For the scope of EDR1 multiple container support has been removed. Ticket CDI-532, is dealing with this feature.

            Show
            antoinesabot-durand Antoine Sabot-Durand added a comment - For the scope of EDR1 multiple container support has been removed. Ticket CDI-532 , is dealing with this feature.

              People

              • Assignee:
                meetoblivion John Ament
                Reporter:
                pmuir Pete Muir
              • Votes:
                5 Vote for this issue
                Watchers:
                11 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Development