You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2016/11/30 12:31:15 UTC
[2/4] isis git commit: ISIS-1545: refactors QueryResultsCache.Control
to inherit from AbstractSubscriber, so initialized early on.
ISIS-1545: refactors QueryResultsCache.Control to inherit from AbstractSubscriber, so initialized early on.
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/56bd6243
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/56bd6243
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/56bd6243
Branch: refs/heads/master
Commit: 56bd62436d2c6c954c4ac7c5124c8e54ef0abf42
Parents: 8377087
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Wed Nov 30 12:13:21 2016 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Wed Nov 30 12:13:21 2016 +0000
----------------------------------------------------------------------
.../queryresultscache/QueryResultsCache.java | 19 ++-----------------
1 file changed, 2 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/56bd6243/core/applib/src/main/java/org/apache/isis/applib/services/queryresultscache/QueryResultsCache.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/queryresultscache/QueryResultsCache.java b/core/applib/src/main/java/org/apache/isis/applib/services/queryresultscache/QueryResultsCache.java
index 6e39a3e..b7f3479 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/services/queryresultscache/QueryResultsCache.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/services/queryresultscache/QueryResultsCache.java
@@ -20,8 +20,6 @@ import java.util.Arrays;
import java.util.Map;
import java.util.concurrent.Callable;
-import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
@@ -31,13 +29,13 @@ import com.google.common.eventbus.Subscribe;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.apache.isis.applib.AbstractSubscriber;
import org.apache.isis.applib.annotation.DomainService;
import org.apache.isis.applib.annotation.NatureOfService;
import org.apache.isis.applib.annotation.Programmatic;
import org.apache.isis.applib.events.system.FixturesInstalledEvent;
import org.apache.isis.applib.events.system.FixturesInstallingEvent;
import org.apache.isis.applib.services.WithTransactionScope;
-import org.apache.isis.applib.services.eventbus.EventBusService;
/**
* This service (API and implementation) provides a mechanism by which idempotent query results can be cached for the duration of an interaction.
@@ -238,17 +236,7 @@ public class QueryResultsCache implements WithTransactionScope {
* In separate class because {@link QueryResultsCache} itself is request-scoped
*/
@DomainService(nature = NatureOfService.DOMAIN)
- public static class Control {
-
- @PostConstruct
- public void postConstruct() {
- eventBusService.register(this);
- }
-
- @PreDestroy
- public void preDestroy() {
- eventBusService.unregister(this);
- }
+ public static class Control extends AbstractSubscriber {
@Subscribe
@org.axonframework.eventhandling.annotation.EventHandler
@@ -267,9 +255,6 @@ public class QueryResultsCache implements WithTransactionScope {
public boolean isFixturesInstalling() {
return fixturesInstalling;
}
-
- @Inject
- EventBusService eventBusService;
}