Return-Path: X-Original-To: apmail-ode-commits-archive@www.apache.org Delivered-To: apmail-ode-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2A02017CEA for ; Fri, 6 Nov 2015 10:55:12 +0000 (UTC) Received: (qmail 92437 invoked by uid 500); 6 Nov 2015 10:55:11 -0000 Delivered-To: apmail-ode-commits-archive@ode.apache.org Received: (qmail 92368 invoked by uid 500); 6 Nov 2015 10:55:11 -0000 Mailing-List: contact commits-help@ode.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ode.apache.org Delivered-To: mailing list commits@ode.apache.org Received: (qmail 91729 invoked by uid 99); 6 Nov 2015 10:55:11 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Nov 2015 10:55:11 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 91A86E042F; Fri, 6 Nov 2015 10:55:11 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sathwik@apache.org To: commits@ode.apache.org Date: Fri, 06 Nov 2015 10:55:33 -0000 Message-Id: <61a11b8519444a12801e6094267cd262@git.apache.org> In-Reply-To: <2be1c5c173c842aca88ac670dc797713@git.apache.org> References: <2be1c5c173c842aca88ac670dc797713@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [23/30] ode git commit: tested with concurrent process tested with concurrent process Project: http://git-wip-us.apache.org/repos/asf/ode/repo Commit: http://git-wip-us.apache.org/repos/asf/ode/commit/9ffe0c77 Tree: http://git-wip-us.apache.org/repos/asf/ode/tree/9ffe0c77 Diff: http://git-wip-us.apache.org/repos/asf/ode/diff/9ffe0c77 Branch: refs/heads/master Commit: 9ffe0c779115515c045888229871187bf3c41a24 Parents: 9a0b742 Author: suba Authored: Wed Jul 15 00:21:09 2015 +0530 Committer: suba Committed: Wed Jul 15 00:21:09 2015 +0530 ---------------------------------------------------------------------- .../java/org/apache/ode/axis2/ODEServer.java | 56 +++++++------------- .../hazelcast/HazelcastInstanceLock.java | 15 ++---- 2 files changed, 24 insertions(+), 47 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ode/blob/9ffe0c77/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java ---------------------------------------------------------------------- diff --git a/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java b/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java index 34e245a..da62139 100644 --- a/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java +++ b/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java @@ -19,38 +19,11 @@ package org.apache.ode.axis2; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Properties; -import java.util.StringTokenizer; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.ThreadFactory; - -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.sql.DataSource; -import javax.transaction.HeuristicMixedException; -import javax.transaction.HeuristicRollbackException; -import javax.transaction.InvalidTransactionException; -import javax.transaction.NotSupportedException; -import javax.transaction.RollbackException; -import javax.transaction.Synchronization; -import javax.transaction.SystemException; -import javax.transaction.Transaction; -import javax.transaction.TransactionManager; -import javax.transaction.xa.XAResource; - import org.apache.axis2.AxisFault; import org.apache.axis2.context.ConfigurationContext; import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager; -import org.apache.commons.httpclient.util.IdleConnectionTimeoutThread; import org.apache.commons.httpclient.params.HttpConnectionManagerParams; +import org.apache.commons.httpclient.util.IdleConnectionTimeoutThread; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.ode.axis2.deploy.DeploymentPoller; @@ -64,12 +37,7 @@ import org.apache.ode.bpel.engine.BpelServerImpl; import org.apache.ode.bpel.engine.CountLRUDehydrationPolicy; import org.apache.ode.bpel.engine.cron.CronScheduler; import org.apache.ode.bpel.extvar.jdbc.JdbcExternalVariableModule; -import org.apache.ode.bpel.iapi.BpelEventListener; -import org.apache.ode.bpel.iapi.EndpointReferenceContext; -import org.apache.ode.bpel.iapi.ProcessConf; -import org.apache.ode.bpel.iapi.ProcessStoreEvent; -import org.apache.ode.bpel.iapi.ProcessStoreListener; -import org.apache.ode.bpel.iapi.Scheduler; +import org.apache.ode.bpel.iapi.*; import org.apache.ode.bpel.intercept.MessageExchangeInterceptor; import org.apache.ode.bpel.memdao.BpelDAOConnectionFactoryImpl; import org.apache.ode.bpel.pmapi.InstanceManagement; @@ -78,11 +46,25 @@ import org.apache.ode.il.config.OdeConfigProperties; import org.apache.ode.il.dbutil.Database; import org.apache.ode.scheduler.simple.JdbcDelegate; import org.apache.ode.scheduler.simple.SimpleScheduler; -import org.apache.ode.store.ProcessStoreImpl; import org.apache.ode.store.ClusterProcessStoreImpl; +import org.apache.ode.store.ProcessStoreImpl; import org.apache.ode.utils.GUID; import org.apache.ode.utils.fs.TempFileManager; +import javax.servlet.ServletConfig; +import javax.servlet.ServletException; +import javax.sql.DataSource; +import javax.transaction.*; +import javax.transaction.xa.XAResource; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.util.*; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.ThreadFactory; + /** * Server class called by our Axis hooks to handle all ODE lifecycle management. * @@ -136,7 +118,7 @@ public class ODEServer { public Runnable txMgrCreatedCallback; - private boolean isClusteringEnabled; + private boolean isClusteringEnabled = false; public void init(ServletConfig config, ConfigurationContext configContext) throws ServletException { init(config.getServletContext().getRealPath("/WEB-INF"), configContext); @@ -213,7 +195,7 @@ public class ODEServer { registerExternalVariableModules(); _store.loadAll(); - _clusterManager.registerClusterProcessStoreMessageListener(); + if (_clusterManager != null) _clusterManager.registerClusterProcessStoreMessageListener(); try { _bpelServer.start(); http://git-wip-us.apache.org/repos/asf/ode/blob/9ffe0c77/clustering/src/main/java/org/apache/ode/clustering/hazelcast/HazelcastInstanceLock.java ---------------------------------------------------------------------- diff --git a/clustering/src/main/java/org/apache/ode/clustering/hazelcast/HazelcastInstanceLock.java b/clustering/src/main/java/org/apache/ode/clustering/hazelcast/HazelcastInstanceLock.java index aa6c086..1729bac 100644 --- a/clustering/src/main/java/org/apache/ode/clustering/hazelcast/HazelcastInstanceLock.java +++ b/clustering/src/main/java/org/apache/ode/clustering/hazelcast/HazelcastInstanceLock.java @@ -46,26 +46,23 @@ public class HazelcastInstanceLock implements ClusterLock { public void lock(Long iid, int time, TimeUnit tu) throws InterruptedException,TimeoutException { if (iid == null) { - if (__log.isDebugEnabled()) { + if (__log.isDebugEnabled()) __log.debug(" Instance Id null at lock[]"); - } return; } String thrd = Thread.currentThread().toString(); - if (__log.isDebugEnabled()) { + if (__log.isDebugEnabled()) __log.debug(thrd + ": lock(iid=" + iid + ", time=" + time + tu + ")"); - } putIfAbsent(iid, iid); if (!_lock_map.tryLock(iid, time, tu)) { - if (__log.isDebugEnabled()) { + if (__log.isDebugEnabled()) __log.debug(thrd + ": lock(iid=" + iid + ", " + "time=" + time + tu + ")-->TIMEOUT"); - } throw new TimeoutException(); } @@ -73,9 +70,8 @@ public class HazelcastInstanceLock implements ClusterLock { public void unlock(Long iid) { if (iid == null) { - if (__log.isDebugEnabled()) { + if (__log.isDebugEnabled()) __log.debug(" unlock, instance id is null"); - } return; } @@ -83,9 +79,8 @@ public class HazelcastInstanceLock implements ClusterLock { _lock_map.unlock(iid); - if (__log.isDebugEnabled()) { + if (__log.isDebugEnabled()) __log.debug(thrd + " unlock(iid=" + iid + ")"); - } } public boolean tryLock(Long key) {