From 08adcf2e783e4733e0fd646d353db3592c62140d Mon Sep 17 00:00:00 2001 From: antelder Date: Thu, 16 Feb 2012 15:43:08 +0000 Subject: Delete old RC tags git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1245046 13f79535-47bb-0310-9956-ffa450edef68 --- .../runtime/IncompatibleIntentException.java | 44 ---- .../TransactionImplementationPolicyProvider.java | 51 ----- .../transaction/runtime/TransactionIntent.java | 34 --- .../runtime/TransactionInterceptor.java | 151 ------------ .../runtime/TransactionManagerHelper.java | 252 --------------------- .../runtime/TransactionPolicyProviderFactory.java | 60 ----- .../TransactionReferencePolicyProvider.java | 51 ----- .../runtime/TransactionServicePolicyProvider.java | 51 ----- .../transaction/runtime/TransactionalAction.java | 31 --- 9 files changed, 725 deletions(-) delete mode 100644 sca-java-2.x/tags/2.0-Beta2-RC1/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/IncompatibleIntentException.java delete mode 100644 sca-java-2.x/tags/2.0-Beta2-RC1/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionImplementationPolicyProvider.java delete mode 100644 sca-java-2.x/tags/2.0-Beta2-RC1/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionIntent.java delete mode 100644 sca-java-2.x/tags/2.0-Beta2-RC1/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionInterceptor.java delete mode 100644 sca-java-2.x/tags/2.0-Beta2-RC1/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionManagerHelper.java delete mode 100644 sca-java-2.x/tags/2.0-Beta2-RC1/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionPolicyProviderFactory.java delete mode 100644 sca-java-2.x/tags/2.0-Beta2-RC1/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionReferencePolicyProvider.java delete mode 100644 sca-java-2.x/tags/2.0-Beta2-RC1/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionServicePolicyProvider.java delete mode 100644 sca-java-2.x/tags/2.0-Beta2-RC1/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionalAction.java (limited to 'sca-java-2.x/tags/2.0-Beta2-RC1/modules/policy-transaction-runtime/src/main/java/org') diff --git a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/IncompatibleIntentException.java b/sca-java-2.x/tags/2.0-Beta2-RC1/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/IncompatibleIntentException.java deleted file mode 100644 index e3cb6fc359..0000000000 --- a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/IncompatibleIntentException.java +++ /dev/null @@ -1,44 +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.tuscany.sca.policy.transaction.runtime; - -/** - * @version $Rev$ $Date$ - */ -public class IncompatibleIntentException extends Exception { - private static final long serialVersionUID = -2993825019200280397L; - - public IncompatibleIntentException() { - super(); - } - - public IncompatibleIntentException(String message, Throwable cause) { - super(message, cause); - } - - public IncompatibleIntentException(String message) { - super(message); - } - - public IncompatibleIntentException(Throwable cause) { - super(cause); - } - -} diff --git a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionImplementationPolicyProvider.java b/sca-java-2.x/tags/2.0-Beta2-RC1/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionImplementationPolicyProvider.java deleted file mode 100644 index dc042ed5cc..0000000000 --- a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionImplementationPolicyProvider.java +++ /dev/null @@ -1,51 +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.tuscany.sca.policy.transaction.runtime; - -import java.util.List; - -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.Phase; -import org.apache.tuscany.sca.invocation.PhasedInterceptor; -import org.apache.tuscany.sca.policy.transaction.TransactionPolicy; -import org.apache.tuscany.sca.provider.BasePolicyProvider; -import org.apache.tuscany.sca.runtime.RuntimeComponent; - -/** - * @version $Rev$ $Date$ - */ -public class TransactionImplementationPolicyProvider extends BasePolicyProvider { - private TransactionManagerHelper helper; - - public TransactionImplementationPolicyProvider(TransactionManagerHelper helper, RuntimeComponent component) { - super(TransactionPolicy.class, component); - this.helper = helper; - } - - public PhasedInterceptor createInterceptor(Operation operation) { - List policies = findPolicies(); - return policies.isEmpty() ? null : new TransactionInterceptor(helper, false, null, policies.get(0), getPhase()); - } - - public String getPhase() { - return Phase.IMPLEMENTATION_POLICY; - } - -} diff --git a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionIntent.java b/sca-java-2.x/tags/2.0-Beta2-RC1/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionIntent.java deleted file mode 100644 index 196b9cc0a1..0000000000 --- a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionIntent.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.tuscany.sca.policy.transaction.runtime; - -/** - * - * @version $Rev$ $Date$ - */ -public enum TransactionIntent { - managedTransactionLocal, - managedTransactionGlobal, - noManagedTransaction, - propagatesTransacton, - suspendsTransaction, - transactedOneWay, - immediateOneWay -} diff --git a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionInterceptor.java b/sca-java-2.x/tags/2.0-Beta2-RC1/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionInterceptor.java deleted file mode 100644 index f6e0e87ece..0000000000 --- a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionInterceptor.java +++ /dev/null @@ -1,151 +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.tuscany.sca.policy.transaction.runtime; - -import java.util.logging.Logger; - -import org.apache.tuscany.sca.invocation.Invoker; -import org.apache.tuscany.sca.invocation.Message; -import org.apache.tuscany.sca.invocation.PhasedInterceptor; -import org.apache.tuscany.sca.policy.transaction.TransactionPolicy; - -/** - * @version $Rev$ $Date$ - */ -public class TransactionInterceptor implements PhasedInterceptor { - private static final Logger logger = Logger.getLogger(TransactionInterceptor.class.getName()); - - private Invoker next; - private TransactionManagerHelper helper; - private boolean outbound; - private TransactionPolicy interactionPolicy; - private TransactionPolicy implementationPolicy; - private String phase; - - public TransactionInterceptor(TransactionManagerHelper helper, - boolean outbound, - TransactionPolicy interactionPolicy, - TransactionPolicy implementationPolicy, - String phase) { - super(); - this.helper = helper; - this.outbound = outbound; - this.interactionPolicy = interactionPolicy; - this.implementationPolicy = implementationPolicy; - } - - /** - * @see org.apache.tuscany.sca.invocation.Interceptor#getNext() - */ - public Invoker getNext() { - return next; - } - - /** - * @see org.apache.tuscany.sca.invocation.Interceptor#setNext(org.apache.tuscany.sca.invocation.Invoker) - */ - public void setNext(Invoker next) { - this.next = next; - } - - /** - * @see org.apache.tuscany.sca.invocation.Invoker#invoke(org.apache.tuscany.sca.invocation.Message) - */ - public Message invoke(Message msg) { - //logger.info("Executing TransactionInterceptor.invoke"); - TransactionalInvocation invocation = new TransactionalInvocation(next, msg); - - Message result = null; - if (msg.getOperation().isNonBlocking()) { - - } - - // initialize default values - TransactionIntent interactionIntent = null; //TransactionIntent.propagatesTransacton; - TransactionIntent implementationIntent = TransactionIntent.managedTransactionGlobal; - - if (interactionPolicy != null) { - if (interactionPolicy.getAction() == TransactionPolicy.Action.PROPAGATE) { - interactionIntent = TransactionIntent.propagatesTransacton; - } else if (interactionPolicy.getAction() == TransactionPolicy.Action.REQUIRE_NONE) { - interactionIntent = TransactionIntent.suspendsTransaction; - if(implementationPolicy == null) { - implementationIntent = TransactionIntent.noManagedTransaction; - } - } else { - interactionIntent = TransactionIntent.suspendsTransaction; - } - } - - if (implementationPolicy != null) { - switch (implementationPolicy.getAction()) { - case REQUIRE_GLOBAL: - implementationIntent = TransactionIntent.managedTransactionGlobal; - break; - case REQUIRE_LOCAL: - implementationIntent = TransactionIntent.managedTransactionLocal; - break; - default: - implementationIntent = TransactionIntent.noManagedTransaction; - break; - } - } - try { - if (outbound) { - result = helper.handlesOutbound(interactionIntent, implementationIntent, invocation); - } else { - result = helper.handlesInbound(interactionIntent, implementationIntent, invocation); - } - - } catch (Throwable e) { - if (e instanceof Error) { - throw (Error)e; - } else if (e instanceof RuntimeException) { - throw (RuntimeException)e; - } else { - result = msg; - msg.setFaultBody(e); - } - - } - return result; - } - - private static class TransactionalInvocation implements TransactionalAction { - private final Invoker invoker; - private final Message message; - - public TransactionalInvocation(Invoker invoker, Message message) { - super(); - this.invoker = invoker; - this.message = message; - } - - public Message run() throws Exception { - return invoker.invoke(message); - } - - } - - public String getPhase() { - return phase; - } - -} diff --git a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionManagerHelper.java b/sca-java-2.x/tags/2.0-Beta2-RC1/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionManagerHelper.java deleted file mode 100644 index 6d67e51bd7..0000000000 --- a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionManagerHelper.java +++ /dev/null @@ -1,252 +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.tuscany.sca.policy.transaction.runtime; - -import java.lang.reflect.InvocationTargetException; - -import javax.transaction.HeuristicMixedException; -import javax.transaction.HeuristicRollbackException; -import javax.transaction.InvalidTransactionException; -import javax.transaction.NotSupportedException; -import javax.transaction.RollbackException; -import javax.transaction.Status; -import javax.transaction.SystemException; -import javax.transaction.Transaction; -import javax.transaction.TransactionManager; - -import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.apache.tuscany.sca.core.UtilityExtensionPoint; - -/** - * @version $Rev$ $Date$ - */ -public class TransactionManagerHelper { - // private static final Logger logger = Logger.getLogger(TransactionManagerHelper.class.getName()); - - private TransactionManager tm; - - public TransactionManagerHelper(ExtensionPointRegistry registry) { - super(); - UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class); - this.tm = utilities.getUtility(TransactionManager.class); - } - - public TransactionManagerHelper(TransactionManager tm) { - super(); - this.tm = tm; - } - - public Transaction managedGlobalTransactionPreInvoke() throws SystemException, NotSupportedException { - int status = tm.getStatus(); - if (status == Status.STATUS_COMMITTED || status == Status.STATUS_NO_TRANSACTION - || status == Status.STATUS_ROLLEDBACK) { - tm.begin(); - return tm.getTransaction(); - } - return null; - } - - public void managedGlobalTransactionPostInvoke(Transaction created, boolean rollback) - throws InvalidTransactionException, IllegalStateException, SystemException, SecurityException, - HeuristicMixedException, HeuristicRollbackException, RollbackException { - if (created != null) { - int status = created.getStatus(); - if (status == Status.STATUS_MARKED_ROLLBACK) { - created.rollback(); - } else if (status == Status.STATUS_ACTIVE) { - if (rollback) { - created.rollback(); - } else { - created.commit(); - } - } - } - } - - public Transaction suspendsTransactionPreInvoke() throws SystemException { - if (tm.getTransaction() != null) { - return tm.suspend(); - } else { - return null; - } - } - - public void suspendsTransactionPostInvoke(Transaction suspended) throws InvalidTransactionException, - IllegalStateException, SystemException { - if (suspended != null) { - tm.resume(suspended); - } - } - - public TransactionManager getTransactionManager() { - return tm; - } - - public void setTransactionManager(TransactionManager tm) { - this.tm = tm; - } - - public void validateOneway(TransactionIntent onewayIntent, TransactionIntent implIntent) - throws IncompatibleIntentException { - if (onewayIntent == TransactionIntent.transactedOneWay) { - if (implIntent != TransactionIntent.managedTransactionGlobal) { - throw new IncompatibleIntentException(onewayIntent + "<-X->" + implIntent); - } - } - } - - public void validateInbound(TransactionIntent serviceIntent, TransactionIntent implIntent) - throws IncompatibleIntentException { - if (serviceIntent == TransactionIntent.propagatesTransacton) { - if (implIntent != TransactionIntent.managedTransactionGlobal) { - throw new IncompatibleIntentException(serviceIntent + "<-X->" + implIntent); - } - } - } - - public void validateOutbound(TransactionIntent referenceIntent, TransactionIntent implIntent) - throws IncompatibleIntentException { - if (referenceIntent == TransactionIntent.propagatesTransacton) { - if (implIntent != TransactionIntent.managedTransactionGlobal) { - throw new IncompatibleIntentException(referenceIntent + "<-X->" + implIntent); - } - } - } - - public T handlesOutbound(TransactionIntent referenceIntent, - TransactionIntent implIntent, - TransactionalAction action) throws Exception { - - if (implIntent == null) { - implIntent = TransactionIntent.noManagedTransaction; - } - - if (referenceIntent == TransactionIntent.propagatesTransacton) { - if (implIntent != TransactionIntent.managedTransactionGlobal) { - throw new IncompatibleIntentException(referenceIntent + "<-X->" + implIntent); - } else { - // propagates the current TX - return run(action); - } - } else if (referenceIntent == TransactionIntent.suspendsTransaction) { - Transaction tx = suspendsTransactionPreInvoke(); - try { - return run(action); - } finally { - suspendsTransactionPostInvoke(tx); - } - } else { - return run(action); - } - } - - private T run(TransactionalAction action) throws Exception { - // Make sure a global TX is in place - Transaction tx = managedGlobalTransactionPreInvoke(); - boolean rollback = false; - try { - return action.run(); - } catch (InvocationTargetException e) { - throw e; - } catch (Throwable e) { - rollback = true; - if (e instanceof Error) { - throw (Error)e; - } else if (e instanceof RuntimeException) { - throw (RuntimeException)e; - } else { - throw (Exception)e; - } - } finally { - managedGlobalTransactionPostInvoke(tx, rollback); - } - } - - public T handlesInbound(TransactionIntent serviceIntent, - TransactionIntent implIntent, - TransactionalAction action) throws Exception { - if (serviceIntent == null && implIntent == null) { - return run(action); - } - - if (implIntent == null) { - implIntent = TransactionIntent.noManagedTransaction; - } - - if (serviceIntent == TransactionIntent.propagatesTransacton) { - if (implIntent != TransactionIntent.managedTransactionGlobal) { - throw new IncompatibleIntentException(serviceIntent + "<-X->" + implIntent); - } else { - return run(action); - } - } else if (serviceIntent == TransactionIntent.suspendsTransaction) { - Transaction tx1 = suspendsTransactionPreInvoke(); - try { - if (implIntent == TransactionIntent.managedTransactionGlobal) { - return run(action); - } else { - return action.run(); - } - } finally { - suspendsTransactionPostInvoke(tx1); - } - } else { - if (implIntent == TransactionIntent.managedTransactionGlobal) { - // Start a new TX - return run(action); - } else { - return action.run(); - } - } - } - - public void handlesOneWay(TransactionIntent onewayIntent, - TransactionIntent implIntent, - TransactionalAction action) throws Exception { - if (implIntent == null) { - implIntent = TransactionIntent.noManagedTransaction; - } - - if (onewayIntent == null) { - // Assume transactedOneWay - run(action); - return; - } - - if (onewayIntent == TransactionIntent.transactedOneWay) { - if (implIntent != TransactionIntent.managedTransactionGlobal) { - throw new IncompatibleIntentException(onewayIntent + "<-X->" + implIntent); - } else { - run(action); - return; - } - } else { - // TransactionIntent.immediateOneWay - Transaction tx = suspendsTransactionPreInvoke(); - try { - run(action); - return; - } finally { - suspendsTransactionPostInvoke(tx); - } - } - } - -} diff --git a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionPolicyProviderFactory.java b/sca-java-2.x/tags/2.0-Beta2-RC1/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionPolicyProviderFactory.java deleted file mode 100644 index 23c25c9b8a..0000000000 --- a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionPolicyProviderFactory.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.tuscany.sca.policy.transaction.runtime; - -import org.apache.tuscany.sca.assembly.Endpoint; -import org.apache.tuscany.sca.assembly.EndpointReference; -import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.apache.tuscany.sca.core.UtilityExtensionPoint; -import org.apache.tuscany.sca.policy.transaction.TransactionPolicy; -import org.apache.tuscany.sca.provider.PolicyProvider; -import org.apache.tuscany.sca.provider.PolicyProviderFactory; -import org.apache.tuscany.sca.runtime.RuntimeComponent; - - -/** - * @version $Rev$ $Date$ - */ -public class TransactionPolicyProviderFactory implements PolicyProviderFactory { - private TransactionManagerHelper helper; - - public TransactionPolicyProviderFactory(ExtensionPointRegistry registry) { - super(); - UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class); - this.helper = utilities.getUtility(TransactionManagerHelper.class); - } - - public PolicyProvider createImplementationPolicyProvider(RuntimeComponent component) { - return new TransactionImplementationPolicyProvider(helper, component); - } - - public PolicyProvider createReferencePolicyProvider(EndpointReference endpointReference) { - return new TransactionReferencePolicyProvider(helper, endpointReference); - } - - public PolicyProvider createServicePolicyProvider(Endpoint endpoint) { - return new TransactionServicePolicyProvider(helper, endpoint); - } - - public Class getModelType() { - return TransactionPolicy.class; - } - -} diff --git a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionReferencePolicyProvider.java b/sca-java-2.x/tags/2.0-Beta2-RC1/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionReferencePolicyProvider.java deleted file mode 100644 index 1dc0feb0b5..0000000000 --- a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionReferencePolicyProvider.java +++ /dev/null @@ -1,51 +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.tuscany.sca.policy.transaction.runtime; - -import java.util.List; - -import org.apache.tuscany.sca.assembly.EndpointReference; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.Phase; -import org.apache.tuscany.sca.invocation.PhasedInterceptor; -import org.apache.tuscany.sca.policy.transaction.TransactionPolicy; -import org.apache.tuscany.sca.provider.BasePolicyProvider; - -/** - * @version $Rev$ $Date$ - */ -public class TransactionReferencePolicyProvider extends BasePolicyProvider { - private TransactionManagerHelper helper; - - public TransactionReferencePolicyProvider(TransactionManagerHelper helper, EndpointReference epr) { - super(TransactionPolicy.class, epr); - this.helper = helper; - } - - public PhasedInterceptor createInterceptor(Operation operation) { - List policies = findPolicies(); - return policies.isEmpty() ? null : new TransactionInterceptor(helper, true, policies.get(0), null, getPhase()); - } - - public String getPhase() { - return Phase.REFERENCE_POLICY; - } - -} diff --git a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionServicePolicyProvider.java b/sca-java-2.x/tags/2.0-Beta2-RC1/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionServicePolicyProvider.java deleted file mode 100644 index c2a7c1039b..0000000000 --- a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionServicePolicyProvider.java +++ /dev/null @@ -1,51 +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.tuscany.sca.policy.transaction.runtime; - -import java.util.List; - -import org.apache.tuscany.sca.assembly.Endpoint; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.Phase; -import org.apache.tuscany.sca.invocation.PhasedInterceptor; -import org.apache.tuscany.sca.policy.transaction.TransactionPolicy; -import org.apache.tuscany.sca.provider.BasePolicyProvider; - -/** - * @version $Rev$ $Date$ - */ -public class TransactionServicePolicyProvider extends BasePolicyProvider { - private TransactionManagerHelper helper; - - public TransactionServicePolicyProvider(TransactionManagerHelper helper, Endpoint ep) { - super(TransactionPolicy.class, ep); - this.helper = helper; - } - - public PhasedInterceptor createInterceptor(Operation operation) { - List policies = findPolicies(); - return policies.isEmpty() ? null : new TransactionInterceptor(helper, true, policies.get(0), null, getPhase()); - } - - public String getPhase() { - return Phase.SERVICE_POLICY; - } - -} diff --git a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionalAction.java b/sca-java-2.x/tags/2.0-Beta2-RC1/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionalAction.java deleted file mode 100644 index 2785177000..0000000000 --- a/sca-java-2.x/tags/2.0-Beta2-RC1/modules/policy-transaction-runtime/src/main/java/org/apache/tuscany/sca/policy/transaction/runtime/TransactionalAction.java +++ /dev/null @@ -1,31 +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.tuscany.sca.policy.transaction.runtime; - -/** - * @version $Rev$ $Date$ - */ -public interface TransactionalAction { - /** - * @return - * @throws Exception - */ - T run() throws Exception; -} -- cgit v1.2.3