You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2019/01/25 10:12:16 UTC
[isis] branch 2033-IoC updated: ISIS-2033: adding markers to
IsisSessionProducerBean
This is an automated email from the ASF dual-hosted git repository.
ahuber pushed a commit to branch 2033-IoC
in repository https://gitbox.apache.org/repos/asf/isis.git
The following commit(s) were added to refs/heads/2033-IoC by this push:
new ea3e328 ISIS-2033: adding markers to IsisSessionProducerBean
ea3e328 is described below
commit ea3e328a6d152939ec343eb76102a947c62f6465
Author: Andi Huber <ah...@apache.org>
AuthorDate: Fri Jan 25 11:12:10 2019 +0100
ISIS-2033: adding markers to IsisSessionProducerBean
which finally should be removed, in order for CDI to take over
Task-Url: https://issues.apache.org/jira/browse/ISIS-2033
---
.../runtime/system/session/IsisSessionProducerBean.java | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionProducerBean.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionProducerBean.java
index c009ad1..5cba4d2 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionProducerBean.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/session/IsisSessionProducerBean.java
@@ -28,20 +28,31 @@ import org.apache.isis.commons.internal.debug._Probe;
import org.apache.isis.core.metamodel.specloader.SpecificationLoader;
import org.apache.isis.core.runtime.system.persistence.PersistenceSessionFactory;
+/**
+ * @deprecated TODO [2033]
+ * Currently `IsisSessionFactory` and those singletons that depend on it
+ * (`SpecificationLoader` and `PersistenceSessionFactory`) are not life-cycle
+ * managed by CDI, instead we provide Producer Methods for these.
+ *
+ * Consequently the framework is responsible for their life-cycles.
+ *
+ * We want to have CDI also manage these, which can be achieved by finally removing the `IsisSessionProducerBean` singleton.
+ *
+ */
@Singleton
public class IsisSessionProducerBean {
- @Produces @Singleton
+ @Produces @Singleton //XXX note: the resulting singleton is not life-cycle managed by CDI, nor are InjectionPoints resolved by CDI
public IsisSessionFactory produceIsisSessionFactory() {
return _Context.computeIfAbsent(IsisSessionFactory.class, this::newIsisSessionFactory);
}
- @Produces @Singleton
+ @Produces @Singleton //XXX note: the resulting singleton is not life-cycle managed by CDI, nor are InjectionPoints resolved by CDI
public SpecificationLoader produceSpecificationLoader() {
return produceIsisSessionFactory().getSpecificationLoader();
}
- @Produces @Singleton
+ @Produces @Singleton //XXX note: the resulting singleton is not life-cycle managed by CDI, nor are InjectionPoints resolved by CDI
public PersistenceSessionFactory producePersistenceSessionFactory() {
return produceIsisSessionFactory().getPersistenceSessionFactory();
}