Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jakartabatch-dev] Please help review PR 181 for option 2 - status quo - Batch + CDI integration

Ok so value "resolution", not injection ;). +1.

Should also mention it is only during job init - instances lookup - and not at runtime so a lazy programmatic value lookup from the bean manager/CDI.current instance will not work.

Le sam. 27 nov. 2021 à 00:10, Scott Kurz <skurz@xxxxxxxxxx> a écrit :

Romain,  

I'm not sure we're talking about the same thing.

I'm trying to say in the spec that for this batchlet/bean:

//@ApplicationScoped
@Dependent
public class MyBatchlet extends AbstractBatchlet {

    @Inject @BatchProperty(name = "a")
    String myProp;

 and this JSL:

     <batchlet ref="...">
            <properties>
                <property name="a"  value="#{jobParameters['paramA']}" />
            </properties>
        </batchlet>

the 'myProp' value injected will be based on job parameter 'paramA', thus not known until execution time.    
More generally, the @BatchProperty Beans will follow the JSL substitution rules for a Dependent-scoped artifact.

In contrast, if the batch artifact Bean is defined with something other than Dependent-scoped, then the property values will be undefined.
I like that we're clarifying a certain behavior around JobScoped/StepScoped, even if we've run out of time to add them to 2.1.

I'm not really trying to say much about an override case.  If the user wants to do something different I'm not trying to stop them in the spec.  

But I'm saying the batch runtime should provide a Bean implementing the above behavior.

-----------------------------------------------------
Scott Kurz
WebSphere / Open Liberty Batch and Developer Experience
skurz@xxxxxxxxxx
--------------------------------------------------------


Inactive hide details for "Romain Manni-Bucau" ---11/26/2021 04:54:44 PM---Please never interprete @Inject without cdi in cdi b"Romain Manni-Bucau" ---11/26/2021 04:54:44 PM---Please never interprete @Inject without cdi in cdi beans, it only break cdi and you will end up prev

From: "Romain Manni-Bucau" <rmannibucau@xxxxxxxxx>
To: "jakartabatch developer discussions" <jakartabatch-dev@xxxxxxxxxxx>
Date: 11/26/2021 04:54 PM
Subject: [EXTERNAL] Re: [jakartabatch-dev] Please help review PR 181 for option 2 - status quo - Batch + CDI integration
Sent by: "jakartabatch-dev" <jakartabatch-dev-bounces@xxxxxxxxxxx>





Please never interprete @Inject without cdi in cdi beans, it only break cdi and you will end up preventing users to actually use cdi. Keep in mind cdi enables to override all beans at startup, including jbatch ones, this would be broken or require extreme caution I understand you want to bypass.

Not aligning cdi and standalone case is fine since standalone is a degraded case. An example is that constructor injection is not supported and nobody really cares so let's stay simple and integrated, no?

Le ven. 26 nov. 2021 à 21:58, Scott Kurz <skurz@xxxxxxxxxx> a écrit :

_______________________________________________
jakartabatch-dev mailing list
jakartabatch-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jakartabatch-dev

GIF image

GIF image


Back to the top