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 2017/05/13 17:46:08 UTC
[1/2] isis git commit: ISIS-1468: extends TransactionService,
adding in getTransactionState
Repository: isis
Updated Branches:
refs/heads/master 56544cb9b -> de83e6eda
ISIS-1468: extends TransactionService, adding in getTransactionState
This promotes TransactionState to the applib, and removes the internal TransactionStateProividerInternalXxx domain services; moved to TransacionServiceDefault simply delegate to the PersistenceSessionServiceInternal for the underlying implementation.
Also updated docs.
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/90dec11e
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/90dec11e
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/90dec11e
Branch: refs/heads/master
Commit: 90dec11e0e9367a8bfd64dd2164adf39411e7589
Parents: 56544cb
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Sat May 13 18:41:30 2017 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Sat May 13 18:41:30 2017 +0100
----------------------------------------------------------------------
...-layer_TransactionStateProviderInternal.adoc | 8 +-
...pplication-layer-api_TransactionService.adoc | 74 ++++++++-------
.../services/xactn/TransactionService2.java | 29 ++++++
.../applib/services/xactn/TransactionState.java | 94 ++++++++++++++++++++
...onInvocationFacetForDomainEventAbstract.java | 31 ++++---
...FacetForDomainEventFromActionAnnotation.java | 5 --
...ainEventFromActionInteractionAnnotation.java | 5 --
...nvocationFacetForDomainEventFromDefault.java | 5 --
...cetForPostsActionInvokedEventAnnotation.java | 5 --
.../PersistenceSessionServiceInternal.java | 5 ++
.../PersistenceSessionServiceInternalNoop.java | 5 ++
.../TransactionStateProviderInternal.java | 34 -------
.../TransactionStateProviderInternalNoop.java | 35 --------
.../xactn/TransactionServiceDefault.java | 60 +++++++++++++
.../TransactionServiceInternalDefault.java | 55 ------------
.../transactions/TransactionState.java | 94 --------------------
.../AbstractFacetFactoryJUnit4TestCase.java | 6 --
.../facets/AbstractFacetFactoryTest.java | 4 -
.../SpecificationLoaderTestAbstract.java | 5 --
...ersistenceSessionServiceInternalDefault.java | 13 ++-
...TransactionStateProviderInternalDefault.java | 60 -------------
.../system/transaction/IsisTransaction.java | 2 +-
22 files changed, 267 insertions(+), 367 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/90dec11e/adocs/documentation/src/main/asciidoc/guides/rgfis/_rgfis_persistence-layer_TransactionStateProviderInternal.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/rgfis/_rgfis_persistence-layer_TransactionStateProviderInternal.adoc b/adocs/documentation/src/main/asciidoc/guides/rgfis/_rgfis_persistence-layer_TransactionStateProviderInternal.adoc
index 297f36d..bd29606 100644
--- a/adocs/documentation/src/main/asciidoc/guides/rgfis/_rgfis_persistence-layer_TransactionStateProviderInternal.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/rgfis/_rgfis_persistence-layer_TransactionStateProviderInternal.adoc
@@ -1,17 +1,15 @@
[[_rgfis_persistence-layer_TransactionStateProviderInternal]]
-= `TransactionStateProviderInternal`
+= `TransactionStateProviderInternal` (removed in `1.15.0-SNAPSHOT`)
: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 agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
:_basedir: ../../
:_imagesdir: images/
-The (internal) `TransactionStateProviderInternal` domain service simply provides the ability to check as to the
-state of the current transaction.
+The (internal) `TransactionStateProviderInternal` domain service simply provides the ability to check as to the state of the current transaction.
[NOTE]
====
-The service will probably be combined with xref:../rgsvc/rgsvc.adoc#_rgsvc_application-layer-api_TransactionService[`TransactionService`]
-in the future.
+This service has been removed in `1.15.0-SNAPSHOT`, having been combined with xref:../rgsvc/rgsvc.adoc#_rgsvc_application-layer-api_TransactionService[`TransactionService`].
====
http://git-wip-us.apache.org/repos/asf/isis/blob/90dec11e/adocs/documentation/src/main/asciidoc/guides/rgsvc/_rgsvc_application-layer-api_TransactionService.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/rgsvc/_rgsvc_application-layer-api_TransactionService.adoc b/adocs/documentation/src/main/asciidoc/guides/rgsvc/_rgsvc_application-layer-api_TransactionService.adoc
index 4e1e8b4..0d08166 100644
--- a/adocs/documentation/src/main/asciidoc/guides/rgsvc/_rgsvc_application-layer-api_TransactionService.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/rgsvc/_rgsvc_application-layer-api_TransactionService.adoc
@@ -1,11 +1,11 @@
[[_rgsvc_application-layer-api_TransactionService]]
-= `TransactionService`
+= `TransactionService2` (`1.15.0-SNAPSHOT`)
: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 agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
:_basedir: ../../
:_imagesdir: images/
-The `TransactionService` provides a small number of methods to allow domain objects to influence user transactions.
+The `TransactionService2` (`1.15.0-SNAPSHOT`) provides a small number of methods to allow domain objects to influence user transactions.
[NOTE]
====
@@ -15,31 +15,50 @@ The methods in this service replace similar methods (now deprecated) in xref:../
== API
-The API of `TransactionService` is:
+The API of `TransactionService2` is:
[source,java]
----
public interface TransactionService {
- Transaction currentTransaction(); // <1>
- void nextTransaction(); // <2>
- void flushTransaction(); // <3>
+ Transaction currentTransaction(); // <1>
+ void nextTransaction(); // <2>
+ void flushTransaction(); // <3>
+ TransactionState getTransactionState(); // <4>
}
----
<1> to obtain a handle on the current `Transaction`, discussed further below
-<2> The framework automatically start a transaction before each user interaction (action invocation or property edit),
-and will commit that transaction after the interaction has completed. Under certain circumstances (eg actions used to
-perform data migration, say, or for large fixture scripts), it can be helpful to programmatically complete one
-transaction and start another one.
+<2> The framework automatically start a transaction before each user interaction (action invocation or property edit), and will commit that transaction after the interaction has completed. Under certain circumstances (eg actions used to perform data migration, say, or for large fixture scripts), it can be helpful to programmatically complete one transaction and start another one.
<3> If the user interaction creates/persists an object or deletes an object (eg using the
-xref:../rgsvc/rgsvc.adoc#_rgsvc_persistence-layer-api_RepositoryService[`RepositoryService`]'s `persist()` or `delete()` methods), then the
-framework actually queues up the work and only performs the persistence command either at the end of the transaction
-or immediately prior to the next query. Performing a flush will cause any pending calls to be performed immediately.
+xref:../rgsvc/rgsvc.adoc#_rgsvc_persistence-layer-api_RepositoryService[`RepositoryService`]'s `persist()` or `delete()` methods), then the framework actually queues up the work and only performs the persistence command either at the end of the transaction or immediately prior to the next query.
+Performing a flush will cause any pending calls to be performed immediately.
+<4> the state of the current or most recently completed transaction.
-The `nextTransaction()` is also used by the xref:../ugvw/ugvw.adoc#[Wicket viewer]'s support for bulk actions; each action
-is invoked in its own transaction.
+Here `TransactionState` is an enum defined as:
-The `Transaction` object - as obtained by `currentTransaction()` method, above - is a minimal wrapper around the
-underlying database transaction. Its API is:
+[source,java]
+----
+public enum TransactionState {
+ NONE, // <1>
+ IN_PROGRESS, // <2>
+ MUST_ABORT, // <3>
+ /**
+ COMMITTED, // <4>
+ ABORTED; // <5>
+}
+----
+<1> No transaction exists.
+<2> Started, still in progress.
+May flush, commit or abort.
+<3> Started, but has hit an exception.
+May not flush or commit, can only abort.
+<4> Completed, having successfully committed.
+May not flush or abort or commit.
+<5> Completed, having aborted.
+Again, may not flush or abort or commit.
+
+The `nextTransaction()` is also used by the xref:../ugvw/ugvw.adoc#[Wicket viewer]'s support for bulk actions; each action is invoked in its own transaction.
+
+The `Transaction` object - as obtained by `currentTransaction()` method, above - is a minimal wrapper around the underlying database transaction. Its API is:
[source,java]
----
@@ -52,16 +71,13 @@ public interface Transaction {
----
<1> is a unique identifier for the interaction/request, as defined by the
xref:../rgcms/rgcms.adoc#_rgcms_classes_mixins_HasTransactionId[`HasTransactionId`] mixin.
-<2> there can actually be multiple transactions within such a request/interaction; the sequence is a (0-based) is used
-to distinguish such.
+<2> there can actually be multiple transactions within such a request/interaction; the sequence is a (0-based) is used to distinguish such.
<3> as per `TransactionService#flushTransaction()` described above.
-<4> If the cause has been rendered higher up in the stack, then clear the cause so that it won't be picked up and
-rendered elsewhere.
+<4> If the cause has been rendered higher up in the stack, then clear the cause so that it won't be picked up and rendered elsewhere.
[TIP]
====
-One place where `clearAboutCause()` may be useful is for application-level handling of SQL integrity exceptions, eg as
-described in link:https://issues.apache.org/jira/browse/ISIS-1476[ISIS-1476]:
+One place where `clearAboutCause()` may be useful is for application-level handling of SQL integrity exceptions, eg as described in link:https://issues.apache.org/jira/browse/ISIS-1476[ISIS-1476]:
[source,java]
----
@@ -82,16 +98,12 @@ try {
== Implementation
-The core framework provides a default implementation of this service (`o.a.i.core.metamodel.services.xactn.TransactionServiceInternalDefault`).
+The core framework provides a default implementation of this service, `o.a.i.core.metamodel.services.xactn.TransactionServiceInternalDefault` (renamed to `TransactionServiceDefault` in `1.15.0-SNAPSHOT`).
+
== Registering the Service
-Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the
-`AppManifest` to xref:../rgcms/rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' core
-implementation of `TransactionService` service is automatically registered and injected (it is annotated with
-`@DomainService`) so no further configuration is required.
+Assuming that the `configuration-and-annotation` services installer is configured (implicit if using the `AppManifest` to xref:../rgcms/rgcms.adoc#_rgcms_classes_AppManifest-bootstrapping[bootstrap the app]) then Apache Isis' core implementation of `TransactionService` service is automatically registered and injected (it is annotated with `@DomainService`) so no further configuration is required.
-To use an alternative implementation, use
-xref:../rgant/rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained
-in the xref:../rgsvc/rgsvc.adoc#__rgsvc_intro_overriding-the-services[introduction] to this guide).
+To use an alternative implementation, use xref:../rgant/rgant.adoc#_rgant-DomainServiceLayout_menuOrder[`@DomainServiceLayout#menuOrder()`] (as explained in the xref:../rgsvc/rgsvc.adoc#__rgsvc_intro_overriding-the-services[introduction] to this guide).
http://git-wip-us.apache.org/repos/asf/isis/blob/90dec11e/core/applib/src/main/java/org/apache/isis/applib/services/xactn/TransactionService2.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/xactn/TransactionService2.java b/core/applib/src/main/java/org/apache/isis/applib/services/xactn/TransactionService2.java
new file mode 100644
index 0000000..0f44090
--- /dev/null
+++ b/core/applib/src/main/java/org/apache/isis/applib/services/xactn/TransactionService2.java
@@ -0,0 +1,29 @@
+/*
+ * 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 agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.applib.services.xactn;
+
+import org.apache.isis.applib.annotation.Programmatic;
+
+public interface TransactionService2 extends TransactionService {
+
+ @Programmatic
+ TransactionState getTransactionState();
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/90dec11e/core/applib/src/main/java/org/apache/isis/applib/services/xactn/TransactionState.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/xactn/TransactionState.java b/core/applib/src/main/java/org/apache/isis/applib/services/xactn/TransactionState.java
new file mode 100644
index 0000000..187ed7d
--- /dev/null
+++ b/core/applib/src/main/java/org/apache/isis/applib/services/xactn/TransactionState.java
@@ -0,0 +1,94 @@
+/*
+ * 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 agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.isis.applib.services.xactn;
+
+public enum TransactionState {
+
+ /**
+ * No transaction exists.
+ */
+ NONE,
+ /**
+ * Started, still in progress.
+ * <p/>
+ * <p/>
+ * May flush, commit or abort.
+ */
+ IN_PROGRESS,
+ /**
+ * Started, but has hit an exception.
+ * <p/>
+ * <p/>
+ * May not flush or commit (will throw an {@link IllegalStateException}),
+ * can only abort.
+ * <p/>
+ * <p/>
+ * Similar to <tt>setRollbackOnly</tt> in EJBs.
+ */
+ MUST_ABORT,
+ /**
+ * Completed, having successfully committed.
+ * <p/>
+ * <p/>
+ * May not flush or abort or commit (will throw {@link IllegalStateException}).
+ */
+ COMMITTED,
+ /**
+ * Completed, having aborted.
+ * <p/>
+ * <p/>
+ * May not flush, commit or abort (will throw {@link IllegalStateException}).
+ */
+ ABORTED;
+
+ private TransactionState() {
+ }
+
+ /**
+ * Whether it is valid to flush the transaction.
+ */
+ public boolean canFlush() {
+ return this == IN_PROGRESS;
+ }
+
+ /**
+ * Whether it is valid to commit the transaction.
+ */
+ public boolean canCommit() {
+ return this == IN_PROGRESS;
+ }
+
+ /**
+ * Whether it is valid to mark as aborted this transaction}.
+ */
+ public boolean canAbort() {
+ return this == IN_PROGRESS || this == MUST_ABORT;
+ }
+
+ /**
+ * Whether the transaction is complete (and so a new one can be started).
+ */
+ public boolean isComplete() {
+ return this == COMMITTED || this == ABORTED;
+ }
+
+ public boolean mustAbort() {
+ return this == MUST_ABORT;
+ }
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/90dec11e/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/ActionInvocationFacetForDomainEventAbstract.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/ActionInvocationFacetForDomainEventAbstract.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/ActionInvocationFacetForDomainEventAbstract.java
index d219779..53f6e34 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/ActionInvocationFacetForDomainEventAbstract.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/ActionInvocationFacetForDomainEventAbstract.java
@@ -19,8 +19,21 @@
package org.apache.isis.core.metamodel.facets.actions.action.invocation;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.sql.Timestamp;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.concurrent.Callable;
+
import com.google.common.base.Strings;
import com.google.common.collect.Lists;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import org.apache.isis.applib.NonRecoverableException;
import org.apache.isis.applib.RecoverableException;
import org.apache.isis.applib.services.bookmark.Bookmark;
@@ -37,6 +50,7 @@ import org.apache.isis.applib.services.metamodel.MetaModelService2;
import org.apache.isis.applib.services.queryresultscache.QueryResultsCache;
import org.apache.isis.applib.services.repository.RepositoryService;
import org.apache.isis.applib.services.xactn.TransactionService;
+import org.apache.isis.applib.services.xactn.TransactionState;
import org.apache.isis.core.commons.authentication.AuthenticationSession;
import org.apache.isis.core.commons.authentication.AuthenticationSessionProvider;
import org.apache.isis.core.commons.config.IsisConfiguration;
@@ -61,26 +75,13 @@ import org.apache.isis.core.metamodel.services.ServicesInjector;
import org.apache.isis.core.metamodel.services.ixn.InteractionDtoServiceInternal;
import org.apache.isis.core.metamodel.services.persistsession.PersistenceSessionServiceInternal;
import org.apache.isis.core.metamodel.services.publishing.PublishingServiceInternal;
-import org.apache.isis.core.metamodel.services.transtate.TransactionStateProviderInternal;
import org.apache.isis.core.metamodel.spec.ObjectSpecification;
import org.apache.isis.core.metamodel.spec.feature.Contributed;
import org.apache.isis.core.metamodel.spec.feature.ObjectAction;
import org.apache.isis.core.metamodel.specloader.ReflectiveActionException;
import org.apache.isis.core.metamodel.specloader.specimpl.MixedInMember2;
-import org.apache.isis.core.metamodel.transactions.TransactionState;
import org.apache.isis.core.runtime.system.transaction.TransactionalClosure;
import org.apache.isis.schema.ixn.v1.ActionInvocationDto;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.sql.Timestamp;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.concurrent.Callable;
public abstract class ActionInvocationFacetForDomainEventAbstract
extends ActionInvocationFacetAbstract
@@ -98,7 +99,6 @@ public abstract class ActionInvocationFacetForDomainEventAbstract
private final ServicesInjector servicesInjector;
private final IsisConfiguration configuration;
- private final TransactionStateProviderInternal transactionStateProviderInternal;
private final Class<? extends ActionDomainEvent<?>> eventType;
private final DomainEventHelper domainEventHelper;
@@ -119,7 +119,6 @@ public abstract class ActionInvocationFacetForDomainEventAbstract
this.persistenceSessionServiceInternal = servicesInjector.getPersistenceSessionServiceInternal();
this.servicesInjector = servicesInjector;
this.configuration = servicesInjector.getConfigurationServiceInternal();
- this.transactionStateProviderInternal = servicesInjector.lookupService(TransactionStateProviderInternal.class);
this.domainEventHelper = new DomainEventHelper(this.servicesInjector);
}
@@ -612,6 +611,6 @@ public abstract class ActionInvocationFacetForDomainEventAbstract
}
public TransactionState getTransactionState() {
- return transactionStateProviderInternal.getTransactionState();
+ return persistenceSessionServiceInternal.getTransactionState();
}
}
http://git-wip-us.apache.org/repos/asf/isis/blob/90dec11e/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/ActionInvocationFacetForDomainEventFromActionAnnotation.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/ActionInvocationFacetForDomainEventFromActionAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/ActionInvocationFacetForDomainEventFromActionAnnotation.java
index a0e87fb..7f05f5e 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/ActionInvocationFacetForDomainEventFromActionAnnotation.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/ActionInvocationFacetForDomainEventFromActionAnnotation.java
@@ -22,14 +22,9 @@ package org.apache.isis.core.metamodel.facets.actions.action.invocation;
import java.lang.reflect.Method;
import org.apache.isis.applib.services.eventbus.ActionDomainEvent;
-import org.apache.isis.core.commons.authentication.AuthenticationSessionProvider;
-import org.apache.isis.core.commons.config.IsisConfiguration;
-import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager;
-import org.apache.isis.core.metamodel.deployment.DeploymentCategory;
import org.apache.isis.core.metamodel.facetapi.FacetHolder;
import org.apache.isis.core.metamodel.services.ServicesInjector;
import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-import org.apache.isis.core.metamodel.services.transtate.TransactionStateProviderInternal;
public class ActionInvocationFacetForDomainEventFromActionAnnotation
extends ActionInvocationFacetForDomainEventAbstract {
http://git-wip-us.apache.org/repos/asf/isis/blob/90dec11e/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/ActionInvocationFacetForDomainEventFromActionInteractionAnnotation.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/ActionInvocationFacetForDomainEventFromActionInteractionAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/ActionInvocationFacetForDomainEventFromActionInteractionAnnotation.java
index 5d8461a..e4875e5 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/ActionInvocationFacetForDomainEventFromActionInteractionAnnotation.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/ActionInvocationFacetForDomainEventFromActionInteractionAnnotation.java
@@ -22,14 +22,9 @@ package org.apache.isis.core.metamodel.facets.actions.action.invocation;
import java.lang.reflect.Method;
import org.apache.isis.applib.services.eventbus.ActionDomainEvent;
-import org.apache.isis.core.commons.authentication.AuthenticationSessionProvider;
-import org.apache.isis.core.commons.config.IsisConfiguration;
-import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager;
-import org.apache.isis.core.metamodel.deployment.DeploymentCategory;
import org.apache.isis.core.metamodel.facetapi.FacetHolder;
import org.apache.isis.core.metamodel.services.ServicesInjector;
import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-import org.apache.isis.core.metamodel.services.transtate.TransactionStateProviderInternal;
/**
* @deprecated
http://git-wip-us.apache.org/repos/asf/isis/blob/90dec11e/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/ActionInvocationFacetForDomainEventFromDefault.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/ActionInvocationFacetForDomainEventFromDefault.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/ActionInvocationFacetForDomainEventFromDefault.java
index cf4f25b..a8f362a 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/ActionInvocationFacetForDomainEventFromDefault.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/ActionInvocationFacetForDomainEventFromDefault.java
@@ -22,14 +22,9 @@ package org.apache.isis.core.metamodel.facets.actions.action.invocation;
import java.lang.reflect.Method;
import org.apache.isis.applib.services.eventbus.ActionDomainEvent;
-import org.apache.isis.core.commons.authentication.AuthenticationSessionProvider;
-import org.apache.isis.core.commons.config.IsisConfiguration;
-import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager;
-import org.apache.isis.core.metamodel.deployment.DeploymentCategory;
import org.apache.isis.core.metamodel.facetapi.FacetHolder;
import org.apache.isis.core.metamodel.services.ServicesInjector;
import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-import org.apache.isis.core.metamodel.services.transtate.TransactionStateProviderInternal;
public class ActionInvocationFacetForDomainEventFromDefault
extends ActionInvocationFacetForDomainEventAbstract {
http://git-wip-us.apache.org/repos/asf/isis/blob/90dec11e/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/ActionInvocationFacetForPostsActionInvokedEventAnnotation.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/ActionInvocationFacetForPostsActionInvokedEventAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/ActionInvocationFacetForPostsActionInvokedEventAnnotation.java
index b9a0933..a2c0741 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/ActionInvocationFacetForPostsActionInvokedEventAnnotation.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/actions/action/invocation/ActionInvocationFacetForPostsActionInvokedEventAnnotation.java
@@ -22,14 +22,9 @@ package org.apache.isis.core.metamodel.facets.actions.action.invocation;
import java.lang.reflect.Method;
import org.apache.isis.applib.services.eventbus.ActionDomainEvent;
-import org.apache.isis.core.commons.authentication.AuthenticationSessionProvider;
-import org.apache.isis.core.commons.config.IsisConfiguration;
-import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager;
-import org.apache.isis.core.metamodel.deployment.DeploymentCategory;
import org.apache.isis.core.metamodel.facetapi.FacetHolder;
import org.apache.isis.core.metamodel.services.ServicesInjector;
import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-import org.apache.isis.core.metamodel.services.transtate.TransactionStateProviderInternal;
/**
* @deprecated
http://git-wip-us.apache.org/repos/asf/isis/blob/90dec11e/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/persistsession/PersistenceSessionServiceInternal.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/persistsession/PersistenceSessionServiceInternal.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/persistsession/PersistenceSessionServiceInternal.java
index 2c494ce..ff8f23a 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/persistsession/PersistenceSessionServiceInternal.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/persistsession/PersistenceSessionServiceInternal.java
@@ -23,6 +23,7 @@ import org.apache.isis.applib.query.Query;
import org.apache.isis.applib.services.bookmark.Bookmark;
import org.apache.isis.applib.services.bookmark.BookmarkService2;
import org.apache.isis.applib.services.xactn.Transaction;
+import org.apache.isis.applib.services.xactn.TransactionState;
import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager;
import org.apache.isis.core.metamodel.spec.ObjectSpecification;
@@ -113,6 +114,10 @@ public interface PersistenceSessionServiceInternal extends AdapterManager {
@Programmatic
Transaction currentTransaction();
+
+ @Programmatic
+ TransactionState getTransactionState();
+
//endregion
//region > makePersistent, remove
http://git-wip-us.apache.org/repos/asf/isis/blob/90dec11e/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/persistsession/PersistenceSessionServiceInternalNoop.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/persistsession/PersistenceSessionServiceInternalNoop.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/persistsession/PersistenceSessionServiceInternalNoop.java
index 7c3c3c8..e46b6e2 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/persistsession/PersistenceSessionServiceInternalNoop.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/persistsession/PersistenceSessionServiceInternalNoop.java
@@ -26,6 +26,7 @@ import org.apache.isis.applib.query.Query;
import org.apache.isis.applib.services.bookmark.Bookmark;
import org.apache.isis.applib.services.bookmark.BookmarkService2;
import org.apache.isis.applib.services.xactn.Transaction;
+import org.apache.isis.applib.services.xactn.TransactionState;
import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
import org.apache.isis.core.metamodel.adapter.oid.Oid;
import org.apache.isis.core.metamodel.spec.ObjectSpecification;
@@ -154,4 +155,8 @@ public class PersistenceSessionServiceInternalNoop implements PersistenceSession
throw new UnsupportedOperationException("Not supported by this implementation of PersistenceSessionServiceInternal");
}
+ @Override
+ public TransactionState getTransactionState() {
+ throw new UnsupportedOperationException("Not supported by this implementation of PersistenceSessionServiceInternal");
+ }
}
http://git-wip-us.apache.org/repos/asf/isis/blob/90dec11e/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/transtate/TransactionStateProviderInternal.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/transtate/TransactionStateProviderInternal.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/transtate/TransactionStateProviderInternal.java
deleted file mode 100644
index b2b1004..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/transtate/TransactionStateProviderInternal.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * 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 agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.core.metamodel.services.transtate;
-
-import org.apache.isis.applib.annotation.Programmatic;
-import org.apache.isis.applib.services.xactn.TransactionService;
-import org.apache.isis.core.metamodel.transactions.TransactionState;
-
-/**
- * TODO: would make sense to combine with {@link TransactionService}.
- */
-public interface TransactionStateProviderInternal {
-
- @Programmatic
- TransactionState getTransactionState();
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/90dec11e/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/transtate/TransactionStateProviderInternalNoop.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/transtate/TransactionStateProviderInternalNoop.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/transtate/TransactionStateProviderInternalNoop.java
deleted file mode 100644
index b565168..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/transtate/TransactionStateProviderInternalNoop.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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 agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.isis.core.metamodel.services.transtate;
-
-import org.apache.isis.applib.annotation.DomainService;
-import org.apache.isis.applib.annotation.NatureOfService;
-import org.apache.isis.core.metamodel.transactions.TransactionState;
-
-@DomainService(
- nature = NatureOfService.DOMAIN,
- menuOrder = "" + Integer.MAX_VALUE
-)
-public class TransactionStateProviderInternalNoop implements TransactionStateProviderInternal {
-
- @Override
- public TransactionState getTransactionState() {
- throw new UnsupportedOperationException("Not supported by this implementation of RuntimeContext");
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/90dec11e/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/xactn/TransactionServiceDefault.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/xactn/TransactionServiceDefault.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/xactn/TransactionServiceDefault.java
new file mode 100644
index 0000000..4b066d0
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/xactn/TransactionServiceDefault.java
@@ -0,0 +1,60 @@
+/*
+ * 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 agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.isis.core.metamodel.services.xactn;
+
+import org.apache.isis.applib.annotation.DomainService;
+import org.apache.isis.applib.annotation.NatureOfService;
+import org.apache.isis.applib.services.xactn.Transaction;
+import org.apache.isis.applib.services.xactn.TransactionService2;
+import org.apache.isis.applib.services.xactn.TransactionState;
+import org.apache.isis.core.metamodel.services.persistsession.PersistenceSessionServiceInternal;
+
+@DomainService(
+ nature = NatureOfService.DOMAIN,
+ menuOrder = "" + Integer.MAX_VALUE
+)
+public class TransactionServiceDefault implements TransactionService2 {
+
+
+ @Override
+ public void flushTransaction() {
+ persistenceSessionServiceInternal.flush();
+ }
+
+ @Override
+ public void nextTransaction() {
+ persistenceSessionServiceInternal.commit();
+ persistenceSessionServiceInternal.beginTran();
+ }
+
+ @Override
+ public Transaction currentTransaction() {
+ return persistenceSessionServiceInternal.currentTransaction();
+ }
+
+ @Override
+ public TransactionState getTransactionState() {
+ return persistenceSessionServiceInternal.getTransactionState();
+ }
+
+ @javax.inject.Inject
+ PersistenceSessionServiceInternal persistenceSessionServiceInternal;
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/90dec11e/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/xactn/TransactionServiceInternalDefault.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/xactn/TransactionServiceInternalDefault.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/xactn/TransactionServiceInternalDefault.java
deleted file mode 100644
index df245f3..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/xactn/TransactionServiceInternalDefault.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * 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 agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.core.metamodel.services.xactn;
-
-import org.apache.isis.applib.annotation.DomainService;
-import org.apache.isis.applib.annotation.NatureOfService;
-import org.apache.isis.applib.services.xactn.Transaction;
-import org.apache.isis.applib.services.xactn.TransactionService;
-import org.apache.isis.core.metamodel.services.persistsession.PersistenceSessionServiceInternal;
-
-@DomainService(
- nature = NatureOfService.DOMAIN,
- menuOrder = "" + Integer.MAX_VALUE
-)
-public class TransactionServiceInternalDefault implements TransactionService {
-
-
- @Override
- public void flushTransaction() {
- persistenceSessionServiceInternal.flush();
- }
-
- @Override
- public void nextTransaction() {
- persistenceSessionServiceInternal.commit();
- persistenceSessionServiceInternal.beginTran();
- }
-
- @Override
- public Transaction currentTransaction() {
- return persistenceSessionServiceInternal.currentTransaction();
- }
-
-
- @javax.inject.Inject
- PersistenceSessionServiceInternal persistenceSessionServiceInternal;
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/90dec11e/core/metamodel/src/main/java/org/apache/isis/core/metamodel/transactions/TransactionState.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/transactions/TransactionState.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/transactions/TransactionState.java
deleted file mode 100644
index e6bf13f..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/transactions/TransactionState.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * 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 agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.isis.core.metamodel.transactions;
-
-public enum TransactionState {
-
- /**
- * No transaction exists.
- */
- NONE,
- /**
- * Started, still in progress.
- * <p/>
- * <p/>
- * May flush, commit or abort.
- */
- IN_PROGRESS,
- /**
- * Started, but has hit an exception.
- * <p/>
- * <p/>
- * May not flush or commit (will throw an {@link IllegalStateException}),
- * can only abort.
- * <p/>
- * <p/>
- * Similar to <tt>setRollbackOnly</tt> in EJBs.
- */
- MUST_ABORT,
- /**
- * Completed, having successfully committed.
- * <p/>
- * <p/>
- * May not flush or abort or commit (will throw {@link IllegalStateException}).
- */
- COMMITTED,
- /**
- * Completed, having aborted.
- * <p/>
- * <p/>
- * May not flush, commit or abort (will throw {@link IllegalStateException}).
- */
- ABORTED;
-
- private TransactionState() {
- }
-
- /**
- * Whether it is valid to flush the transaction.
- */
- public boolean canFlush() {
- return this == IN_PROGRESS;
- }
-
- /**
- * Whether it is valid to commit the transaction.
- */
- public boolean canCommit() {
- return this == IN_PROGRESS;
- }
-
- /**
- * Whether it is valid to mark as aborted this transaction}.
- */
- public boolean canAbort() {
- return this == IN_PROGRESS || this == MUST_ABORT;
- }
-
- /**
- * Whether the transaction is complete (and so a new one can be started).
- */
- public boolean isComplete() {
- return this == COMMITTED || this == ABORTED;
- }
-
- public boolean mustAbort() {
- return this == MUST_ABORT;
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/90dec11e/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/AbstractFacetFactoryJUnit4TestCase.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/AbstractFacetFactoryJUnit4TestCase.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/AbstractFacetFactoryJUnit4TestCase.java
index 5a80218..af2ca76 100644
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/AbstractFacetFactoryJUnit4TestCase.java
+++ b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/AbstractFacetFactoryJUnit4TestCase.java
@@ -41,7 +41,6 @@ import org.apache.isis.core.metamodel.facetapi.MethodRemover;
import org.apache.isis.core.metamodel.facets.object.domainobject.autocomplete.AutoCompleteFacetForDomainObjectAnnotation;
import org.apache.isis.core.metamodel.services.ServicesInjector;
import org.apache.isis.core.metamodel.services.persistsession.PersistenceSessionServiceInternal;
-import org.apache.isis.core.metamodel.services.transtate.TransactionStateProviderInternal;
import org.apache.isis.core.metamodel.spec.ObjectSpecification;
import org.apache.isis.core.metamodel.spec.feature.OneToManyAssociation;
import org.apache.isis.core.metamodel.spec.feature.OneToOneActionParameter;
@@ -67,8 +66,6 @@ public abstract class AbstractFacetFactoryJUnit4TestCase {
protected ServicesInjector mockServicesInjector;
@Mock
protected TranslationService mockTranslationService;
- @Mock
- protected TransactionStateProviderInternal mockTransactionStateProviderInternal;
@Mock
protected IsisConfigurationDefault mockConfiguration;
@@ -117,9 +114,6 @@ public abstract class AbstractFacetFactoryJUnit4TestCase {
allowing(mockServicesInjector).lookupService(DeploymentCategoryProvider.class);
will(returnValue(mockDeploymentCategoryProvider));
- allowing(mockServicesInjector).lookupService(TransactionStateProviderInternal.class);
- will(returnValue(mockTransactionStateProviderInternal));
-
allowing(mockDeploymentCategoryProvider).getDeploymentCategory();
will(returnValue(DeploymentCategory.PRODUCTION));
http://git-wip-us.apache.org/repos/asf/isis/blob/90dec11e/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/AbstractFacetFactoryTest.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/AbstractFacetFactoryTest.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/AbstractFacetFactoryTest.java
index 12fd5be..4f10c97 100644
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/AbstractFacetFactoryTest.java
+++ b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/AbstractFacetFactoryTest.java
@@ -40,7 +40,6 @@ import org.apache.isis.core.metamodel.facetapi.FeatureType;
import org.apache.isis.core.metamodel.facetapi.IdentifiedHolder;
import org.apache.isis.core.metamodel.services.ServicesInjector;
import org.apache.isis.core.metamodel.services.persistsession.PersistenceSessionServiceInternal;
-import org.apache.isis.core.metamodel.services.transtate.TransactionStateProviderInternal;
import org.apache.isis.core.metamodel.spec.ObjectSpecification;
import org.apache.isis.core.metamodel.specloader.SpecificationLoader;
import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2;
@@ -71,7 +70,6 @@ public abstract class AbstractFacetFactoryTest extends TestCase {
protected AuthenticationSessionProvider mockAuthenticationSessionProvider;
protected AuthenticationSession mockAuthenticationSession;
- protected TransactionStateProviderInternal mockTransactionStateProviderInternal;
protected PersistenceSessionServiceInternal mockPersistenceSessionServiceInternal;
protected IsisConfigurationDefault stubConfiguration;
@@ -117,12 +115,10 @@ public abstract class AbstractFacetFactoryTest extends TestCase {
mockAuthenticationSession = context.mock(AuthenticationSession.class);
mockPersistenceSessionServiceInternal = context.mock(PersistenceSessionServiceInternal.class);
- mockTransactionStateProviderInternal = context.mock(TransactionStateProviderInternal.class);
mockSpecificationLoader = context.mock(SpecificationLoader.class);
stubServicesInjector = new ServicesInjector(Lists.newArrayList(
- mockTransactionStateProviderInternal,
stubConfiguration,
mockAuthenticationSessionProvider,
mockSpecificationLoader,
http://git-wip-us.apache.org/repos/asf/isis/blob/90dec11e/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/SpecificationLoaderTestAbstract.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/SpecificationLoaderTestAbstract.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/SpecificationLoaderTestAbstract.java
index 3d6e4b6..8f4a51c 100644
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/SpecificationLoaderTestAbstract.java
+++ b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/SpecificationLoaderTestAbstract.java
@@ -46,7 +46,6 @@ import org.apache.isis.core.metamodel.layoutmetadata.json.LayoutMetadataReaderFr
import org.apache.isis.core.metamodel.metamodelvalidator.dflt.MetaModelValidatorDefault;
import org.apache.isis.core.metamodel.services.ServicesInjector;
import org.apache.isis.core.metamodel.services.persistsession.PersistenceSessionServiceInternal;
-import org.apache.isis.core.metamodel.services.transtate.TransactionStateProviderInternal;
import org.apache.isis.core.metamodel.spec.ObjectSpecification;
import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2;
import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2.Mode;
@@ -69,8 +68,6 @@ public abstract class SpecificationLoaderTestAbstract {
@Mock
private PersistenceSessionServiceInternal mockPersistenceSessionServiceInternal;
@Mock
- private TransactionStateProviderInternal mockTransactionStateProviderInternal;
- @Mock
private MessageService mockMessageService;
ServicesInjector stubServicesInjector;
@@ -91,7 +88,6 @@ public abstract class SpecificationLoaderTestAbstract {
ignoring(mockGridService).existsFor(with(any(Class.class)));
ignoring(mockPersistenceSessionServiceInternal);
- ignoring(mockTransactionStateProviderInternal);
ignoring(mockMessageService);
}});
@@ -106,7 +102,6 @@ public abstract class SpecificationLoaderTestAbstract {
mockDeploymentCategoryProvider,
mockPersistenceSessionServiceInternal,
mockMessageService,
- mockTransactionStateProviderInternal,
mockGridService,
mockDeploymentCategoryProvider),
stubConfiguration);
http://git-wip-us.apache.org/repos/asf/isis/blob/90dec11e/core/runtime/src/main/java/org/apache/isis/core/runtime/services/persistsession/PersistenceSessionServiceInternalDefault.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/persistsession/PersistenceSessionServiceInternalDefault.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/persistsession/PersistenceSessionServiceInternalDefault.java
index a016dfc..954b492 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/persistsession/PersistenceSessionServiceInternalDefault.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/persistsession/PersistenceSessionServiceInternalDefault.java
@@ -27,6 +27,7 @@ import org.apache.isis.applib.query.Query;
import org.apache.isis.applib.services.bookmark.Bookmark;
import org.apache.isis.applib.services.bookmark.BookmarkService2;
import org.apache.isis.applib.services.xactn.Transaction;
+import org.apache.isis.applib.services.xactn.TransactionState;
import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
import org.apache.isis.core.metamodel.adapter.oid.Oid;
import org.apache.isis.core.metamodel.adapter.oid.RootOid;
@@ -36,6 +37,7 @@ import org.apache.isis.core.metamodel.spec.feature.OneToManyAssociation;
import org.apache.isis.core.metamodel.specloader.SpecificationLoader;
import org.apache.isis.core.runtime.system.persistence.PersistenceSession;
import org.apache.isis.core.runtime.system.session.IsisSessionFactory;
+import org.apache.isis.core.runtime.system.transaction.IsisTransaction;
import org.apache.isis.core.runtime.system.transaction.IsisTransactionManager;
import org.apache.isis.core.runtime.system.transaction.TransactionalClosure;
@@ -179,6 +181,16 @@ public class PersistenceSessionServiceInternalDefault implements PersistenceSess
getTransactionManager().executeWithinTransaction(transactionalClosure);
}
+ @Override
+ public TransactionState getTransactionState() {
+ final IsisTransaction transaction = getTransactionManager().getCurrentTransaction();
+ if (transaction == null) {
+ return TransactionState.NONE;
+ }
+ IsisTransaction.State state = transaction.getState();
+ return state.getRuntimeContextState();
+ }
+
protected PersistenceSession getPersistenceSession() {
return getIsisSessionFactory().getCurrentSession().getPersistenceSession();
}
@@ -200,5 +212,4 @@ public class PersistenceSessionServiceInternalDefault implements PersistenceSess
@javax.inject.Inject
IsisSessionFactory isisSessionFactory;
-
}
http://git-wip-us.apache.org/repos/asf/isis/blob/90dec11e/core/runtime/src/main/java/org/apache/isis/core/runtime/services/transtate/TransactionStateProviderInternalDefault.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/transtate/TransactionStateProviderInternalDefault.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/transtate/TransactionStateProviderInternalDefault.java
deleted file mode 100644
index 92ed143..0000000
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/transtate/TransactionStateProviderInternalDefault.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * 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 agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.isis.core.runtime.services.transtate;
-
-import javax.inject.Inject;
-
-import org.apache.isis.applib.annotation.DomainService;
-import org.apache.isis.applib.annotation.NatureOfService;
-import org.apache.isis.core.metamodel.services.transtate.TransactionStateProviderInternal;
-import org.apache.isis.core.metamodel.transactions.TransactionState;
-import org.apache.isis.core.runtime.system.persistence.PersistenceSession;
-import org.apache.isis.core.runtime.system.session.IsisSessionFactory;
-import org.apache.isis.core.runtime.system.transaction.IsisTransaction;
-import org.apache.isis.core.runtime.system.transaction.IsisTransactionManager;
-
-
-@DomainService(
- nature = NatureOfService.DOMAIN,
- menuOrder = "" + (Integer.MAX_VALUE - 1) // ie before the Noop impl in metamodel
-)
-public class TransactionStateProviderInternalDefault implements TransactionStateProviderInternal {
-
- @Override
- public TransactionState getTransactionState() {
- final IsisTransaction transaction = getTransactionManager().getCurrentTransaction();
- if (transaction == null) {
- return TransactionState.NONE;
- }
- IsisTransaction.State state = transaction.getState();
- return state.getRuntimeContextState();
- }
-
- private IsisTransactionManager getTransactionManager() {
- return getPersistenceSession().getTransactionManager();
- }
-
- private PersistenceSession getPersistenceSession() {
- return isisSessionFactory.getCurrentSession().getPersistenceSession();
- }
-
- @javax.inject.Inject
- IsisSessionFactory isisSessionFactory;
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/90dec11e/core/runtime/src/main/java/org/apache/isis/core/runtime/system/transaction/IsisTransaction.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/transaction/IsisTransaction.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/transaction/IsisTransaction.java
index be7a32a..6a4b474 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/transaction/IsisTransaction.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/transaction/IsisTransaction.java
@@ -39,7 +39,7 @@ import org.apache.isis.core.commons.util.ToString;
import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
import org.apache.isis.core.metamodel.services.ServicesInjector;
import org.apache.isis.core.metamodel.services.publishing.PublishingServiceInternal;
-import org.apache.isis.core.metamodel.transactions.TransactionState;
+import org.apache.isis.applib.services.xactn.TransactionState;
import org.apache.isis.core.runtime.persistence.objectstore.transaction.CreateObjectCommand;
import org.apache.isis.core.runtime.persistence.objectstore.transaction.DestroyObjectCommand;
import org.apache.isis.core.runtime.persistence.objectstore.transaction.PersistenceCommand;
[2/2] isis git commit: ISIS-1614: fixes responsive menu bar for
tertiary menu
Posted by da...@apache.org.
ISIS-1614: fixes responsive menu bar for tertiary menu
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/de83e6ed
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/de83e6ed
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/de83e6ed
Branch: refs/heads/master
Commit: de83e6edaa5657dd78859aea9837a09b59188912
Parents: 90dec11
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Sat May 13 18:28:38 2017 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Sat May 13 18:42:09 2017 +0100
----------------------------------------------------------------------
.../viewer/wicket/ui/components/header/HeaderPanel.html | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/de83e6ed/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/header/HeaderPanel.html
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/header/HeaderPanel.html b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/header/HeaderPanel.html
index e887868..06c8ef9 100644
--- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/header/HeaderPanel.html
+++ b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/header/HeaderPanel.html
@@ -36,7 +36,11 @@
<img alt="Brand" wicket:id="brandLogo"/>
</a>
</div>
- <div class="navbar-header navbar-right">
+ <div class="navbar-collapse app-actions collapse navbar-left">
+ <ul class="nav navbar-nav" wicket:id="primaryMenuBar"></ul>
+ </div>
+ <div class="navbar-collapse app-actions collapse navbar-right">
+ <ul class="nav navbar-nav" wicket:id="secondaryMenuBar"></ul>
<ul class="nav navbar-nav tertiary">
<li class="dropdown">
<a tabindex="-1" href="#" class="dropdown-toggle" data-toggle="dropdown">
@@ -47,12 +51,6 @@
</li>
</ul>
</div>
- <div class="navbar-collapse app-actions collapse navbar-right">
- <ul class="nav navbar-nav" wicket:id="secondaryMenuBar"></ul>
- </div>
- <div class="navbar-collapse app-actions collapse">
- <ul class="nav navbar-nav" wicket:id="primaryMenuBar"></ul>
- </div>
</div>
</header>