Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cu-dev] Classes on which the XYZDefinition is valid in case of CDI
  • From: Nathan Rauh <nathan.rauh@xxxxxxxxxx>
  • Date: Thu, 25 Apr 2024 15:16:48 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=us.ibm.com; dmarc=pass action=none header.from=us.ibm.com; dkim=pass header.d=us.ibm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=HZiXKsBGHKAoUAoCiZV+fFc/Fil9deS8Z1YU+aeTDkg=; b=Iq9Xd9lICxQaEtZeR71hCIoQAJBO7xHRHUMRZ/mPTkCBca5wVfhXZ2PyFXMd3mLQxK1IxlMIeVo47qyoMzjK4bGfmc1YXSMmjuUuZWqjplPsLweA7PkDOKcoIXQhKRy2Pf0riKEtMvxPeGkEw/LA/6fBv/c0O2+8e/laS5nCQYnxZwlXcJE20IDXvT8mx28TljTlEo8q1g3prAUI7JEx/lpSiygKWiuOJ4g+xex0/Njx0B6JMYnZ7pN8DMOA4mNJgMfOChxEOir5cOuoNJdu7vtJKVgM6x4XFFEi/GP1v/RLja0iKOlXI3J2GtB74P25st6vniEG5GqrrMlV0yKrhA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b9df5hZF9HcQRUwMnR9VaVMH6q/tytso/9SvSSXGEJ/vA9f+WU928EbaDNbGbQlBaHw9YZ9MALlTDxnXJsxhAt50TMT59mhnJ+0wupSHa5rf6pvQiy6Wrm3bRj9zGbtpLVH7gavdWlWGsZwNknJRXSUYtPtt6R1UZF07MkNyoyW42bXv/pBuH+wOjlQCyCjbBLF4VS2gO12loITpcjUUHGz7fHvec7+lPDOK+Zh2xnSuBrKl8T7zYy2QFnFM3rzOBYTpC43QjsRD7TrszHldTsPLnmhZNJR6mDrXqtbZkNeFxfbdE/h9Xy4KXD4mYBwe9cCMdFZS0CqeGoN1piK0VQ==
  • Delivered-to: cu-dev@xxxxxxxxxxx
  • List-archive: <https://www.eclipse.org/mailman/private/cu-dev/>
  • List-help: <mailto:cu-dev-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/cu-dev>, <mailto:cu-dev-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/cu-dev>, <mailto:cu-dev-request@eclipse.org?subject=unsubscribe>
  • Thread-index: AQHalx4dsdd4cbPM9E+K8DTXjQHaTbF5FVgh
  • Thread-topic: [EXTERNAL] [cu-dev] Classes on which the XYZDefinition is valid in case of CDI

Arjan,


The resource definition classes (ManagedExecutorDefinition) were not intended to be allowed on any class.  They were intended to follow after DataSourceDefinition, which says, “
A DataSource resource may also be defined using the DataSourceDefinition annotation on a container-managed class, such as a servlet or enterprise bean class.” (from the Jakarta EE spec).  Also note that the Jakarta EE spec makes this same statement about ConnectionFactoryDefinition, AdministeredObjectDefinition, … and many others.  The Jakarta EE spec does not have sections for the concurrency resource definitions.  I looked around and unfortunately did not see anywhere that the Concurrency spec or JavaDoc states where the resource definition classes are allowed to be used.  This information is missing and needs to be added, either at the Concurrency spec/javadoc level or Jakarta EE spec level.  It would be nice to see the Concurrency resource definitions mentioned alongside the others.

 

Our own implementation of Concurrency treats these resource definitions the same as DataSourceDefinition and the other resource definition annotations.

 

 

From: cu-dev <cu-dev-bounces@xxxxxxxxxxx> on behalf of Arjan Tijms via cu-dev <cu-dev@xxxxxxxxxxx>
Date: Thursday, April 25, 2024 at 9:37
AM
To: cu developer discussions <cu-dev@xxxxxxxxxxx>
Cc: Arjan Tijms <arjan.tijms@xxxxxxxxxxx>
Subject: [EXTERNAL] [cu-dev] Classes on which the XYZDefinition is valid in case of CDI

Hi, The XYZDefinition classes in Concurrency are currently legal to be placed on any class, as the JNDI scanning code seemingly always scans every class in the application. In CDI however there are limitations on which classes are scanned,

Hi,

 

The XYZDefinition classes in Concurrency are currently legal to be placed on any class, as the JNDI scanning code seemingly always scans every class in the application.

 

In CDI however there are limitations on which classes are scanned, and depending on several settings not all classes are scanned. 

 

So a problem occurs when an XYZDefinition appears on a class that is not scanned by CDI, but does use qualifiers. In that case, CDI will not directly get to see the class and the JNDI scanning code must somehow put it somewhere where CDI can find it. This is however not trivial, as we don't even know whether JNDI or CDI is initialized first (we never specified anything about ordering in Jakarta EE, which is its own problem, but for now we need to deal with that).

 

I wonder if we should update the specification to say that whenever qualifiers are used with an XYZDefinition annotation, they are only legal to be placed on any type of class that CDI can scan.

 

Thoughts?

 

Kind regards,

Arjan Tijms


Back to the top