From e2629c8f3fb5d5cc50a6b14ab5a0ae3337eae171 Mon Sep 17 00:00:00 2001 From: Robert von Burg Date: Sun, 24 Aug 2014 19:18:20 +0200 Subject: [PATCH] [Major] moved ObserverHandler to StrolchRealm - no component anymore Now the ObserverHandler is not a StrolchComponent anymore, and can be retrieved from the StrolchRealm. This makes the observer model be part of the realm, not global of the agent. --- .../li/strolch/persistence/xml/XmlPersistenceHandler.java | 7 +------ .../persistence/impl/dao/test/ObserverUpdateTest.java | 4 ++-- .../cachedruntime/config/StrolchConfiguration.xml | 5 ----- .../existingDbRuntime/config/StrolchConfiguration.xml | 5 ----- .../transactionalruntime/config/StrolchConfiguration.xml | 5 ----- 5 files changed, 3 insertions(+), 23 deletions(-) diff --git a/src/main/java/li/strolch/persistence/xml/XmlPersistenceHandler.java b/src/main/java/li/strolch/persistence/xml/XmlPersistenceHandler.java index 0892ed331..59663ef41 100644 --- a/src/main/java/li/strolch/persistence/xml/XmlPersistenceHandler.java +++ b/src/main/java/li/strolch/persistence/xml/XmlPersistenceHandler.java @@ -34,7 +34,6 @@ import li.strolch.persistence.xml.model.AuditContextFactory; import li.strolch.persistence.xml.model.OrderContextFactory; import li.strolch.persistence.xml.model.ResourceContextFactory; import li.strolch.runtime.configuration.ComponentConfiguration; -import li.strolch.runtime.observer.ObserverHandler; import ch.eitchnet.privilege.model.Certificate; import ch.eitchnet.xmlpers.api.IoMode; import ch.eitchnet.xmlpers.api.PersistenceConstants; @@ -81,11 +80,7 @@ public class XmlPersistenceHandler extends StrolchComponent implements Persisten @Override public StrolchTransaction openTx(StrolchRealm realm, Certificate certificate, String action) { PersistenceTransaction tx = this.persistenceManager.openTx(realm.getRealm()); - XmlStrolchTransaction strolchTx = new XmlStrolchTransaction(realm, certificate, action, tx, this); - if (getContainer().hasComponent(ObserverHandler.class)) { - strolchTx.setObserverHandler(getContainer().getComponent(ObserverHandler.class)); - } - return strolchTx; + return new XmlStrolchTransaction(realm, certificate, action, tx, this); } @Override diff --git a/src/test/java/li/strolch/persistence/impl/dao/test/ObserverUpdateTest.java b/src/test/java/li/strolch/persistence/impl/dao/test/ObserverUpdateTest.java index f8aeed7f7..559d1e2e8 100644 --- a/src/test/java/li/strolch/persistence/impl/dao/test/ObserverUpdateTest.java +++ b/src/test/java/li/strolch/persistence/impl/dao/test/ObserverUpdateTest.java @@ -25,6 +25,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import li.strolch.agent.api.Observer; +import li.strolch.agent.api.ObserverHandler; import li.strolch.model.Order; import li.strolch.model.Resource; import li.strolch.model.State; @@ -32,8 +34,6 @@ import li.strolch.model.StrolchRootElement; import li.strolch.model.Tags; import li.strolch.persistence.api.StrolchTransaction; import li.strolch.runtime.StrolchConstants; -import li.strolch.runtime.observer.Observer; -import li.strolch.runtime.observer.ObserverHandler; import li.strolch.runtime.privilege.PrivilegeHandler; import li.strolch.testbase.runtime.RuntimeMock; diff --git a/src/test/resources/cachedruntime/config/StrolchConfiguration.xml b/src/test/resources/cachedruntime/config/StrolchConfiguration.xml index d3bb5edd6..9eb4d1fcf 100644 --- a/src/test/resources/cachedruntime/config/StrolchConfiguration.xml +++ b/src/test/resources/cachedruntime/config/StrolchConfiguration.xml @@ -34,10 +34,5 @@ true - - ObserverHandler - li.strolch.runtime.observer.ObserverHandler - li.strolch.runtime.observer.DefaultObserverHandler - \ No newline at end of file diff --git a/src/test/resources/existingDbRuntime/config/StrolchConfiguration.xml b/src/test/resources/existingDbRuntime/config/StrolchConfiguration.xml index 6236d62b9..eec57334a 100644 --- a/src/test/resources/existingDbRuntime/config/StrolchConfiguration.xml +++ b/src/test/resources/existingDbRuntime/config/StrolchConfiguration.xml @@ -33,10 +33,5 @@ true - - ObserverHandler - li.strolch.runtime.observer.ObserverHandler - li.strolch.runtime.observer.DefaultObserverHandler - \ No newline at end of file diff --git a/src/test/resources/transactionalruntime/config/StrolchConfiguration.xml b/src/test/resources/transactionalruntime/config/StrolchConfiguration.xml index d6bdf4eb0..017e5165b 100644 --- a/src/test/resources/transactionalruntime/config/StrolchConfiguration.xml +++ b/src/test/resources/transactionalruntime/config/StrolchConfiguration.xml @@ -34,10 +34,5 @@ true - - ObserverHandler - li.strolch.runtime.observer.ObserverHandler - li.strolch.runtime.observer.DefaultObserverHandler - \ No newline at end of file