This is an automated email from the ASF dual-hosted git repository. danhaywood pushed a commit to branch CAUSEWAY-3866 in repository https://gitbox.apache.org/repos/asf/causeway.git
commit 995f65232bc7e9ce697b075fea92c26757b19b52 Author: Dan Haywood <[email protected]> AuthorDate: Sat Oct 18 09:12:16 2025 +0100 CAUSEWAY-3866: updates references to javax.annotation --- .../hooks/DomainServiceLayout_021-menuBar.adoc | 2 +- ...ontentMappingService_020-examples-and-usage.adoc | 2 +- .../GridSystemService_020-examples-and-usage.adoc | 2 +- .../RoutingService_020-examples-and-usage.adoc | 2 +- .../refguide/modules/applib-ant/pages/Nullable.adoc | 21 +++++++++++---------- .../refguide/modules/applib-svc/pages/about.adoc | 4 ++-- .../partials/domain-services/initialization.adoc | 2 +- .../partials/domain-services/inject-services.adoc | 2 +- .../ROOT/partials/domain-services/overriding.adoc | 2 +- .../properties-collections-actions/properties.adoc | 2 +- .../replacing-default-service-implementations.adoc | 2 +- .../main/adoc/modules/webapp/pages/webmodules.adoc | 2 +- .../CausewayModulePersistenceJpaEclipselink.java | 1 + 13 files changed, 24 insertions(+), 22 deletions(-) diff --git a/antora/components/refguide-index/modules/applib/pages/index/annotation/hooks/DomainServiceLayout_021-menuBar.adoc b/antora/components/refguide-index/modules/applib/pages/index/annotation/hooks/DomainServiceLayout_021-menuBar.adoc index a3a6788b7a0..945e2ac608c 100644 --- a/antora/components/refguide-index/modules/applib/pages/index/annotation/hooks/DomainServiceLayout_021-menuBar.adoc +++ b/antora/components/refguide-index/modules/applib/pages/index/annotation/hooks/DomainServiceLayout_021-menuBar.adoc @@ -24,7 +24,7 @@ In the xref:vw:ROOT:about.adoc[Web UI (Wicket viewer)], domain services placed: * on the `SECONDARY` menu bar appear to the right: * on the `TERTIARY` appear in the menu bar associated with the user's name (far top-right) -The grouping of multiple domain services actions within a single drop-down is managed by the `@javax.annotation.Priority` annotation. +The grouping of multiple domain services actions within a single drop-down is managed by the `@jakarta.annotation.Priority` annotation. NOTE: The xref:vro:ROOT:about.adoc[RestfulObjects viewer] does not support this attribute. diff --git a/antora/components/refguide-index/modules/applib/pages/index/services/conmap/hooks/ContentMappingService_020-examples-and-usage.adoc b/antora/components/refguide-index/modules/applib/pages/index/services/conmap/hooks/ContentMappingService_020-examples-and-usage.adoc index 13ffc3ca608..7242a618e27 100644 --- a/antora/components/refguide-index/modules/applib/pages/index/services/conmap/hooks/ContentMappingService_020-examples-and-usage.adoc +++ b/antora/components/refguide-index/modules/applib/pages/index/services/conmap/hooks/ContentMappingService_020-examples-and-usage.adoc @@ -7,7 +7,7 @@ The `ContentMappingService` supports the (default implementation of the) internal xref:refguide:viewer:index/restfulobjects/rendering/service/conneg/ContentNegotiationService.adoc[ContentNegotiationService] SPI enabling the xref:vro:ROOT:about.adoc[RestfulObjects viewer] to represent domain objects in some other format as specified by the HTTP `Accept` header. For its part, the (default implementation of the) `ContentNegotiationService` will check _all_ available implementations of `ContentMappingService` to convert the domain object to the requested media type, rather than merely the first implementation found; in other words it uses the link:https://en.wikipedia.org/wiki/Chain-of-responsibility_pattern[chain-of-responsibility] pattern. -Services are checked in the ordering defined by the `@javax.annotation.Priority` annotation. +Services are checked in the ordering defined by the `@jakarta.annotation.Priority` annotation. The mapped object used will be the first (= earlies encountered) non-`null` result returned by an implementation. diff --git a/antora/components/refguide-index/modules/applib/pages/index/services/grid/hooks/GridSystemService_020-examples-and-usage.adoc b/antora/components/refguide-index/modules/applib/pages/index/services/grid/hooks/GridSystemService_020-examples-and-usage.adoc index 3e98e1ee783..c7428d79394 100644 --- a/antora/components/refguide-index/modules/applib/pages/index/services/grid/hooks/GridSystemService_020-examples-and-usage.adoc +++ b/antora/components/refguide-index/modules/applib/pages/index/services/grid/hooks/GridSystemService_020-examples-and-usage.adoc @@ -4,7 +4,7 @@ == Usage Notes The framework will check _all_ available implementations of `GridSystemService` to obtain available grid systems, rather than merely the first implementation found, to determine if a grid is available for the domain object to be rendered; in other words it uses the link:https://en.wikipedia.org/wiki/Chain-of-responsibility_pattern[chain-of-responsibility] pattern. -Services are called in the order defined by the `@javax.annotation.Priority` annotation. +Services are called in the order defined by the `@jakarta.annotation.Priority` annotation. Note though that each concrete implementation must also provide corresponding Wicket viewer components capable of interpreting the grid layout. This is therefore a highly specialized and very deep customisation of the framework. diff --git a/antora/components/refguide-index/modules/applib/pages/index/services/routing/hooks/RoutingService_020-examples-and-usage.adoc b/antora/components/refguide-index/modules/applib/pages/index/services/routing/hooks/RoutingService_020-examples-and-usage.adoc index e20226f3efe..bb20cf5ce88 100644 --- a/antora/components/refguide-index/modules/applib/pages/index/services/routing/hooks/RoutingService_020-examples-and-usage.adoc +++ b/antora/components/refguide-index/modules/applib/pages/index/services/routing/hooks/RoutingService_020-examples-and-usage.adoc @@ -7,7 +7,7 @@ Unlike most other domain services, the framework will check _all_ available implementations of `RoutingService` to return a route, rather than the first implementation found; in other words it uses the chain-of-responsibility pattern. -Services are called in the order defined by the `@javax.annotation.Priority` annotation. +Services are called in the order defined by the `@jakarta.annotation.Priority` annotation. The route used will be the result of the first implementation checked that declares that it can provide a route. diff --git a/antora/components/refguide/modules/applib-ant/pages/Nullable.adoc b/antora/components/refguide/modules/applib-ant/pages/Nullable.adoc index 47645df9e1e..0a19fa890bf 100644 --- a/antora/components/refguide/modules/applib-ant/pages/Nullable.adoc +++ b/antora/components/refguide/modules/applib-ant/pages/Nullable.adoc @@ -1,5 +1,5 @@ [#jakarta-annotation-Nullable] -= @Nullable (jakarta.annotation) += @Nullable (jakarta.annotation & org.jspecify.annotations) :Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...] @@ -7,26 +7,27 @@ Apache Causeway' defaults for properties and parameters is that they are mandatory unless otherwise stated. -The `@javax.annotation.Nullable` annotation is recognized by Apache Causeway for both properties and parameters as means to indicate that the property/parameter is not mandatory. +Both the `@jakarta.annotation.Nullable` annotation and `@org.jspecify.annotations.Nullable` annotation are recognized by Apache Causeway for both properties and parameters as means to indicate that the property/parameter is not mandatory. For example: [source,java] ---- [email protected] -public String getName() { - return name; -} -public void setName(final String name) { - this.name = name; -} +import jakarta.annotation.Nullable; + +@Nullable +@Getter @Setter +private String name; ---- or: [source,java] ---- -public Customer updateName(@javax.annotation.Nullable final String name) { +import jakarta.annotation.Nullable; + +public Customer updateName( + @Nullable final String name) { setName(name); return this; } diff --git a/antora/components/refguide/modules/applib-svc/pages/about.adoc b/antora/components/refguide/modules/applib-svc/pages/about.adoc index 2004d5e61b7..f8719ba7add 100644 --- a/antora/components/refguide/modules/applib-svc/pages/about.adoc +++ b/antora/components/refguide/modules/applib-svc/pages/about.adoc @@ -20,7 +20,7 @@ What distinguishes API from SPI is primarily whether it is called by the domain In one sense all API domain services are also SPI, in that they can be overridden by the domain programmer providing another domain service implementing the same type. For example, the framework-provided implementation of xref:refguide:applib:index/services/repository/RepositoryService.adoc[RepositoryService] could be overridden this way, perhaps for more monitoring or caching purposes. -This is done using the `@javax.annotation.Priority` annotation. +This is done using the `@jakarta.annotation.Priority` annotation. Generally speaking in such cases the earliest encountered implementation (= highest priority) will be used instead of the framework-provided implementation. For some services, though, _all_ available implementations are delegated to; these are typically subscribers such as xref:refguide:applib:index/services/publishing/spi/EntityPropertyChangeSubscriber.adoc[EntityPropertyChangeSubscriber]. @@ -98,7 +98,7 @@ Alternatively the object can be instantiated simply using `new`, then services i The framework provides default implementations for many of the domain services. This is convenient, but sometimes you will want to replace the default implementation with your own service implementation. -This is most commonly done using the `@javax.annotation.Priority` annotation. +This is most commonly done using the `@jakarta.annotation.Priority` annotation. The xref:refguide:applib:index/annotation/PriorityPrecedence.adoc[PriorityPrecedence] class provides some pre-defined precedences. * If a scalar field is being injected to, the earliest implementation encountered (= highest priority) is used diff --git a/antora/components/userguide/modules/ROOT/partials/domain-services/initialization.adoc b/antora/components/userguide/modules/ROOT/partials/domain-services/initialization.adoc index c173b6c884d..89bac7053fa 100644 --- a/antora/components/userguide/modules/ROOT/partials/domain-services/initialization.adoc +++ b/antora/components/userguide/modules/ROOT/partials/domain-services/initialization.adoc @@ -10,7 +10,7 @@ In many cases, such initialization can be performed within the constructor. If the initialization has dependencies, then these can be injected using standard link:https://docs.spring.io/spring-boot/docs/current/reference/html/using-spring-boot.html#using-boot-spring-beans-and-dependency-injection[constructor injection]. Alternatively, initialization can be moved into a `@PostConstruct` link:https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#beans-postconstruct-and-predestroy-annotations[lifecycle callback]. -Shutdown is similar; the framework will call any method annotated with `javax.annotation.PreDestroy`. +Shutdown is similar; the framework will call any method annotated with `jakarta.annotation.PreDestroy`. If a domain service needs to wait until the framework is fully initialized though, it should register for the `MetamodelEvent` that is emitted by the framework itself. One example is if the service is to seed some reference data: diff --git a/antora/components/userguide/modules/ROOT/partials/domain-services/inject-services.adoc b/antora/components/userguide/modules/ROOT/partials/domain-services/inject-services.adoc index 8d98e1df8dd..a3147c8f2a1 100644 --- a/antora/components/userguide/modules/ROOT/partials/domain-services/inject-services.adoc +++ b/antora/components/userguide/modules/ROOT/partials/domain-services/inject-services.adoc @@ -162,7 +162,7 @@ public class DocumentService { } ---- -These will be in the order as defined by the `@javax.annotation.Priority` annotation. +These will be in the order as defined by the `@jakarta.annotation.Priority` annotation. This pattern can be useful when implementing the link:https://en.wikipedia.org/wiki/Chain-of-responsibility_pattern[chain of responsibility] design pattern, that is, looking for the first implementation that can handle a request. diff --git a/antora/components/userguide/modules/ROOT/partials/domain-services/overriding.adoc b/antora/components/userguide/modules/ROOT/partials/domain-services/overriding.adoc index c27f40bc244..af3b502ef80 100644 --- a/antora/components/userguide/modules/ROOT/partials/domain-services/overriding.adoc +++ b/antora/components/userguide/modules/ROOT/partials/domain-services/overriding.adoc @@ -4,7 +4,7 @@ :page-partial: Apache Causeway runs on top of Spring Boot, and relies on Spring Boot for dependency injection using `@javax.inject.Inject`. -The `@javax.annotation.Priority` annotation is used to prioritize multiple service implementations. +The `@jakarta.annotation.Priority` annotation is used to prioritize multiple service implementations. This allows any framework-provided domain service to be replaced by a user-defined one if required, simply by assigning it with an earlier precedence (= higher priority). If this is done, then you will probably also want to implement your replacement using `@org.springframework.context.annotation.Primary`, to resolve the ambiguity of there being more than one implementation of the service on the classpath. diff --git a/antora/components/userguide/modules/ROOT/partials/properties-collections-actions/properties.adoc b/antora/components/userguide/modules/ROOT/partials/properties-collections-actions/properties.adoc index 50562a05401..44e9935fb84 100644 --- a/antora/components/userguide/modules/ROOT/partials/properties-collections-actions/properties.adoc +++ b/antora/components/userguide/modules/ROOT/partials/properties-collections-actions/properties.adoc @@ -84,7 +84,7 @@ However, it _isn't_ valid for a domain entity to hold a reference to view model, To override optionality, use the `@Basic(optional="...")` annotation. Apache Causeway on the other hand assumes that all properties (and action parameters, for that matter) are mandatory, not optional. -These defaults can also be overridden using Apache Causeway' own annotations, specifically `@Property(optionality=...)`, or (because it's much less verbose) using `@javax.annotation.Nullable`. +These defaults can also be overridden using Apache Causeway' own annotations, specifically `@Property(optionality=...)`, or (because it's much less verbose) using either `@jakarta.annotation.Nullable` or `@org.jspecify.annotations.Nullable`. These different defaults can lead to incompatibilities between the two frameworks. To counteract that, Apache Causeway also recognizes and honours JPA's `@Column(nullable=...)`. diff --git a/antora/components/userguide/modules/btb/partials/hints-and-tips/replacing-default-service-implementations.adoc b/antora/components/userguide/modules/btb/partials/hints-and-tips/replacing-default-service-implementations.adoc index 84f7c60c6af..d508c2f5311 100644 --- a/antora/components/userguide/modules/btb/partials/hints-and-tips/replacing-default-service-implementations.adoc +++ b/antora/components/userguide/modules/btb/partials/hints-and-tips/replacing-default-service-implementations.adoc @@ -10,7 +10,7 @@ The framework provides default implementations for many of the xref:refguide:app This is convenient, but sometimes you will want to replace the default implementation with your own service implementation. For example, suppose you wanted to provide your own implementation of xref:refguide:applib:index/services/i18n/LanguageProvider.adoc[LanguageProvider]. -The trick is to use the `@javax.annotation.Priority` annotation. +The trick is to use the `@jakarta.annotation.Priority` annotation. Here's how: diff --git a/core/webapp/src/main/adoc/modules/webapp/pages/webmodules.adoc b/core/webapp/src/main/adoc/modules/webapp/pages/webmodules.adoc index e240b8b4ed3..d73fdae1790 100644 --- a/core/webapp/src/main/adoc/modules/webapp/pages/webmodules.adoc +++ b/core/webapp/src/main/adoc/modules/webapp/pages/webmodules.adoc @@ -5,7 +5,7 @@ The `WebModule` interface allows modules to dynamically configure ``Filter``s, ``Servlet``s and ``ServletContextListener``s. -The `@javax.annotation.Priority` annotation is used to ensure that the request chain is sequenced correctly. +The `@jakarta.annotation.Priority` annotation is used to ensure that the request chain is sequenced correctly. .WebModules (priority determines filter sequence, earliest first) [cols="6m,^4a,^2a,^3m,^3m,8a", options="header"] diff --git a/persistence/jpa/eclipselink/src/main/java/org/apache/causeway/persistence/jpa/eclipselink/CausewayModulePersistenceJpaEclipselink.java b/persistence/jpa/eclipselink/src/main/java/org/apache/causeway/persistence/jpa/eclipselink/CausewayModulePersistenceJpaEclipselink.java index 29c8df92492..54baf7dfd28 100644 --- a/persistence/jpa/eclipselink/src/main/java/org/apache/causeway/persistence/jpa/eclipselink/CausewayModulePersistenceJpaEclipselink.java +++ b/persistence/jpa/eclipselink/src/main/java/org/apache/causeway/persistence/jpa/eclipselink/CausewayModulePersistenceJpaEclipselink.java @@ -72,6 +72,7 @@ public class CausewayModulePersistenceJpaEclipselink extends JpaBaseConfiguratio @Inject private ElSettings elSettings; + @Inject protected CausewayModulePersistenceJpaEclipselink( final CausewayConfiguration causewayConfiguration, final DataSource dataSource,
