[jboss-cvs] JBossAS SVN: r114684 - in branches/JBPAPP_5_1_1_GA_JBPAPP-10980: cluster/src/etc and 40 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Feb 3 16:52:58 EST 2014
Author: bmaxwell
Date: 2014-02-03 16:52:57 -0500 (Mon, 03 Feb 2014)
New Revision: 114684
Added:
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/ejb3/jbpapp8035/
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/ejb3/jbpapp8035/TimerSample.java
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/ejb3/jbpapp8035/TimerSampleBean.java
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/ejb3/jbpapp8035/unit/
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/ejb3/jbpapp8035/unit/OverloadTimerServiceTestCase.java
Removed:
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/ejb3/jbpapp8035/TimerSample.java
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/ejb3/jbpapp8035/TimerSampleBean.java
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/ejb3/jbpapp8035/unit/
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/ejb3/jbpapp8035/unit/OverloadTimerServiceTestCase.java
Modified:
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/.gitignore
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/cluster/src/etc/hapartition-jboss-beans.xml
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/cluster/src/main/org/jboss/ha/framework/server/lock/AbstractClusterLockSupport.java
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/cluster/src/main/org/jboss/ha/framework/server/lock/ClusterLockState.java
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/cluster/src/main/org/jboss/ha/framework/server/lock/NonGloballyExclusiveClusterLockSupport.java
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/cluster/src/main/org/jboss/ha/framework/server/lock/YieldingGloballyExclusiveClusterLockSupport.java
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/connector/src/main/org/jboss/resource/connectionmanager/xa/XAResourceWrapperImpl.java
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/connector/src/main/org/jboss/resource/connectionmanager/xa/XidWrapperImpl.java
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/ejb3/src/main/org/jboss/as/ejb3/timerservice/JBossTimerServiceFactory.java
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/main/src/bin/run.conf.bat
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/main/src/bin/run.sh
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/messaging/src/main/org/jboss/jms/server/destination/QueueMODefinition.java
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/etc/conf/all/bootstrap.xml
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/etc/conf/all/bootstrap/aop.xml
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/etc/conf/all/bootstrap/classloader.xml
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/etc/conf/all/bootstrap/deployers.xml
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/etc/conf/all/bootstrap/jmx.xml
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/etc/conf/all/bootstrap/logging.xml
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/etc/conf/all/bootstrap/vfs.xml
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/etc/conf/all/java.policy
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/etc/conf/all/jax-ws-catalog.xml
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/etc/conf/all/jboss-log4j.xml
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/etc/conf/all/jboss-service.xml
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/etc/conf/all/login-config.xml
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/etc/conf/all/props/
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/etc/conf/all/standardjboss.xml
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/etc/conf/all/standardjbosscmp-jdbc.xml
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/etc/conf/all/xmdesc/
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/etc/conf/all/xmdesc/NamingProviderURLWriter-xmbean.xml
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/etc/conf/minimal/bootstrap.xml
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/etc/conf/minimal/jboss-service.xml
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/etc/deploy/legacy-invokers-service.xml
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/etc/deployers/logbridge-jboss-beans.xml
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/main/org/jboss/deployment/FileNameVirtualFileFilter.java
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/main/org/jboss/ejb/txtimer/EJBTimerServiceImpl.java
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/main/org/jboss/ejb/txtimer/EJBTimerServiceImplMBean.java
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/main/org/jboss/ejb/txtimer/TimerImpl.java
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/main/org/jboss/ejb/txtimer/TimerServiceImpl.java
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/system/src/main/org/jboss/system/server/profileservice/repository/AbstractBootstrapProfileFactory.java
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/system/src/resources/parsing-tests/common/profiles/clustering.profile
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/system/src/resources/parsing-tests/common/profiles/ejb3.profile
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/system/src/resources/parsing-tests/common/profiles/jboss-web.profile
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/system/src/resources/parsing-tests/config/profiles/default.profile
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/system/src/resources/parsing-tests/config/profiles/seam.profile
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/system/src/tests/org/jboss/test/server/profileservice/support/MavenProfileMetaData.java
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/imports/sections/ejb3.xml
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/bootstrapdependencies/jbas5349/ejb2/
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/bootstrapdependencies/jbas5349/ejb3/
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/bootstrapdependencies/jbas5349/sar/
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/bootstrapdependencies/jbas5349/servlet/
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/bootstrapdependencies/jbas5349/test/
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/classloader/leak/test/Ejb3ClassloaderLeakTestBase.java
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/classloader/leak/test/IsolatedEarWithDualCommonsLoggingClassloaderLeakTestCase.java
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/classloader/leak/test/J2EEClassloaderLeakTestBase.java
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/cluster/classloader/leak/test/FieldGranularityClassloaderLeakTestBase.java
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/cluster/classloader/leak/test/J2EEClassloaderLeakTestBase.java
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/YieldingGloballyExclusiveClusterLockSupportUnitTestCase.java
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/cluster/web/notification/SessionSpecListenerAttribute.java
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/ejb3/common/AbstractReplierMDB.java
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/ejb3/common/EJB3TestCase.java
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/ejb3/jbpapp2260/TransactionMDB.java
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/ejb3/jbpapp2260/unit/
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/spring/test/SpringFacadeTestCase.java
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/resources/bootstrapdependencies/jbas5349/
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/tools/buildmagic/lib/
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/varia/src/main/org/jboss/services/binding/ServiceBindingMetadata.java
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/varia/src/main/org/jboss/services/binding/managed/ServiceBindingMapper.java
branches/JBPAPP_5_1_1_GA_JBPAPP-10980/varia/src/resources/seam/jboss-structure.xml
Log:
[JBPAPP-10980] introduced a ScheduledExecutorService for handling the timeout callbacks
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980
___________________________________________________________________
Added: svn:mergeinfo
+ /branches/JBPAPP_5_1:112630
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/.gitignore
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/cluster/src/etc/hapartition-jboss-beans.xml
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/cluster/src/main/org/jboss/ha/framework/server/lock/AbstractClusterLockSupport.java
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/cluster/src/main/org/jboss/ha/framework/server/lock/ClusterLockState.java
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/cluster/src/main/org/jboss/ha/framework/server/lock/NonGloballyExclusiveClusterLockSupport.java
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/cluster/src/main/org/jboss/ha/framework/server/lock/YieldingGloballyExclusiveClusterLockSupport.java
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/connector/src/main/org/jboss/resource/connectionmanager/xa/XAResourceWrapperImpl.java
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/connector/src/main/org/jboss/resource/connectionmanager/xa/XidWrapperImpl.java
___________________________________________________________________
Deleted: svn:mergeinfo
-
Modified: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/ejb3/src/main/org/jboss/as/ejb3/timerservice/JBossTimerServiceFactory.java
===================================================================
--- branches/JBPAPP_5_1_1_GA_JBPAPP-10980/ejb3/src/main/org/jboss/as/ejb3/timerservice/JBossTimerServiceFactory.java 2014-02-03 21:40:15 UTC (rev 114683)
+++ branches/JBPAPP_5_1_1_GA_JBPAPP-10980/ejb3/src/main/org/jboss/as/ejb3/timerservice/JBossTimerServiceFactory.java 2014-02-03 21:52:57 UTC (rev 114684)
@@ -21,9 +21,6 @@
*/
package org.jboss.as.ejb3.timerservice;
-import javax.ejb.TimerService;
-import javax.management.ObjectName;
-
import org.jboss.ejb.AllowedOperationsAssociation;
import org.jboss.ejb.txtimer.EJBTimerService;
import org.jboss.ejb3.timerservice.spi.TimedObjectInvoker;
@@ -32,6 +29,9 @@
import org.jboss.mx.util.MBeanProxyExt;
import org.jboss.mx.util.MBeanServerLocator;
+import javax.ejb.TimerService;
+import javax.management.ObjectName;
+
/**
* Factory to create timer services which use the JBoss EJB Timer Service.
*
@@ -87,15 +87,7 @@
}
catch (Exception e)
{
- //throw new EJBException("Could not remove timer service", e);
- if (log.isTraceEnabled())
- {
- log.trace("Unable to initialize timer service", e);
- }
- else
- {
- log.trace("Unable to initialize timer service");
- }
+ log.warn("Unable to remove timer service", e);
}
}
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/main/src/bin/run.conf.bat
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/main/src/bin/run.sh
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/JBPAPP_4_2_0_GA_CP/system/src/bin/run.sh:108548
+ /branches/JBPAPP_4_2_0_GA_CP/system/src/bin/run.sh:108548
/branches/JBPAPP_5_1/main/src/bin/run.sh:112630
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/messaging/src/main/org/jboss/jms/server/destination/QueueMODefinition.java
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/etc/conf/all/bootstrap/aop.xml
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/etc/conf/all/bootstrap/classloader.xml
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/etc/conf/all/bootstrap/deployers.xml
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/etc/conf/all/bootstrap/jmx.xml
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/etc/conf/all/bootstrap/logging.xml
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/etc/conf/all/bootstrap/vfs.xml
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/etc/conf/all/bootstrap.xml
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/etc/conf/all/java.policy
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/etc/conf/all/jax-ws-catalog.xml
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/etc/conf/all/jboss-log4j.xml
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/etc/conf/all/jboss-service.xml
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/etc/conf/all/login-config.xml
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/etc/conf/all/props
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/etc/conf/all/standardjboss.xml
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/etc/conf/all/standardjbosscmp-jdbc.xml
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/etc/conf/all/xmdesc
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/etc/conf/all/xmdesc/NamingProviderURLWriter-xmbean.xml
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/etc/conf/minimal/bootstrap.xml
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/etc/conf/minimal/jboss-service.xml
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/etc/deploy/legacy-invokers-service.xml
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/etc/deployers/logbridge-jboss-beans.xml
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/main/org/jboss/deployment/FileNameVirtualFileFilter.java
___________________________________________________________________
Deleted: svn:mergeinfo
-
Modified: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/main/org/jboss/ejb/txtimer/EJBTimerServiceImpl.java
===================================================================
--- branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/main/org/jboss/ejb/txtimer/EJBTimerServiceImpl.java 2014-02-03 21:40:15 UTC (rev 114683)
+++ branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/main/org/jboss/ejb/txtimer/EJBTimerServiceImpl.java 2014-02-03 21:52:57 UTC (rev 114684)
@@ -23,6 +23,20 @@
// $Id$
+import org.jboss.ejb.Container;
+import org.jboss.ejb.ContainerMBean;
+import org.jboss.logging.Logger;
+import org.jboss.mx.util.MBeanProxyExt;
+import org.jboss.system.ServiceMBeanSupport;
+import org.jboss.tm.TransactionManagerFactory;
+import org.jboss.tm.TransactionManagerLocator;
+
+import javax.ejb.EJBException;
+import javax.ejb.Timer;
+import javax.ejb.TimerService;
+import javax.management.ObjectInstance;
+import javax.management.ObjectName;
+import javax.transaction.TransactionManager;
import java.io.Serializable;
import java.lang.reflect.Constructor;
import java.util.Collection;
@@ -33,21 +47,6 @@
import java.util.List;
import java.util.Map;
-import javax.ejb.EJBException;
-import javax.ejb.Timer;
-import javax.ejb.TimerService;
-import javax.management.ObjectInstance;
-import javax.management.ObjectName;
-import javax.transaction.TransactionManager;
-
-import org.jboss.ejb.Container;
-import org.jboss.ejb.ContainerMBean;
-import org.jboss.logging.Logger;
-import org.jboss.mx.util.MBeanProxyExt;
-import org.jboss.system.ServiceMBeanSupport;
-import org.jboss.tm.TransactionManagerFactory;
-import org.jboss.tm.TransactionManagerLocator;
-
/**
* A service that implements this interface provides an Tx aware EJBTimerService.
*
@@ -127,6 +126,9 @@
// Maps the timedObjectId to TimerServiceImpl objects
private Map<TimedObjectId, TimerServiceImpl> timerServiceMap = Collections.synchronizedMap(new HashMap<TimedObjectId, TimerServiceImpl>());
+ // A pool of timer that avoid creating one thread per task.
+ private Integer threadPoolSize = new Integer(50);
+
// Attributes ----------------------------------------------------
/**
@@ -216,7 +218,27 @@
{
this.transactionManagerFactory = factory;
}
-
+
+ /**
+ * Get the ThreadPoolSize
+ *
+ * @jmx.managed-attribute
+ */
+ public Integer getThreadPoolSize()
+ {
+ return threadPoolSize;
+ }
+
+ /**
+ * Set the threadPoolSize
+ *
+ * @jmx.managed-attribute
+ */
+ public void setThreadPoolSize(Integer threadPoolSize)
+ {
+ this.threadPoolSize = threadPoolSize;
+ }
+
// ServiceMBeanSupport Lifecycle ---------------------------------
protected void startService() throws Exception
@@ -228,7 +250,7 @@
transactionManager = transactionManagerFactory.getTransactionManager();
else
transactionManager = TransactionManagerLocator.getInstance().locate();
-
+
// Get a proxy to the retry policy
try
{
@@ -291,7 +313,7 @@
* The TimedObjectInvoker is constructed from the invokerClassName.
*
* @param containerId The string identifier for a class of TimedObjects
- * @param instancePk The rimary key for an instance of a TimedObject, may be null
+ * @param instancePk The primary key for an instance of a TimedObject, may be null
* @param container The Container that is associated with the TimerService
* @return the TimerService
*/
@@ -329,7 +351,7 @@
if (timerService == null)
{
timerService = new TimerServiceImpl(timedObjectId, invoker,
- transactionManager, persistencePolicy, retryPolicy, timerIdGenerator);
+ transactionManager, persistencePolicy, retryPolicy, timerIdGenerator, getThreadPoolSize());
log.debug("createTimerService: " + timerService);
timerServiceMap.put(timedObjectId, timerService);
}
Modified: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/main/org/jboss/ejb/txtimer/EJBTimerServiceImplMBean.java
===================================================================
--- branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/main/org/jboss/ejb/txtimer/EJBTimerServiceImplMBean.java 2014-02-03 21:40:15 UTC (rev 114683)
+++ branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/main/org/jboss/ejb/txtimer/EJBTimerServiceImplMBean.java 2014-02-03 21:52:57 UTC (rev 114684)
@@ -21,12 +21,12 @@
*/
package org.jboss.ejb.txtimer;
-import javax.management.ObjectName;
-
import org.jboss.mx.util.ObjectNameFactory;
import org.jboss.system.ServiceMBean;
import org.jboss.tm.TransactionManagerFactory;
+import javax.management.ObjectName;
+
/**
* EJBTimerServiceImpl MBean interface.
*
@@ -61,6 +61,10 @@
/** The TransactionManagerFactory */
void setTransactionManagerFactory(TransactionManagerFactory factory);
+ Integer getThreadPoolSize();
+ /** Sets the thread pool size for running timeout callbacks, takes effect on restart of the timer service */
+ void setThreadPoolSize(Integer threadPoolSize);
+
// Operations ----------------------------------------------------
/**
Modified: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/main/org/jboss/ejb/txtimer/TimerImpl.java
===================================================================
--- branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/main/org/jboss/ejb/txtimer/TimerImpl.java 2014-02-03 21:40:15 UTC (rev 114683)
+++ branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/main/org/jboss/ejb/txtimer/TimerImpl.java 2014-02-03 21:52:57 UTC (rev 114684)
@@ -23,10 +23,8 @@
// $Id$
-import java.io.Serializable;
-import java.util.Date;
-import java.util.Timer;
-import java.util.TimerTask;
+import org.jboss.ejb.AllowedOperationsAssociation;
+import org.jboss.logging.Logger;
import javax.ejb.EJBException;
import javax.ejb.NoSuchObjectLocalException;
@@ -34,9 +32,13 @@
import javax.transaction.Status;
import javax.transaction.Synchronization;
import javax.transaction.Transaction;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.TimerTask;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledFuture;
-import org.jboss.ejb.AllowedOperationsAssociation;
-import org.jboss.logging.Logger;
+import static java.util.concurrent.TimeUnit.MILLISECONDS;
/**
* An implementation of an EJB Timer.
@@ -96,7 +98,7 @@
private long nextExpire;
private int timerState;
- private Timer utilTimer;
+ private ScheduledFuture<Void> scheduledFuture;
private int hashCode;
/**
@@ -119,6 +121,11 @@
setTimerState(CREATED);
}
+ private ScheduledExecutorService executor()
+ {
+ return timerService.getScheduledExecutorService();
+ }
+
void startTimer(Date firstTime, long periode)
{
this.startTimer(firstTime, firstTime, periode);
@@ -252,7 +259,7 @@
if (timerState != EXPIRED)
setTimerState(CANCELED);
timerService.removeTimer(this);
- utilTimer.cancel();
+ scheduledFuture.cancel(false);
}
/**
@@ -262,7 +269,8 @@
{
if (timerState != EXPIRED)
setTimerState(CANCELED);
- utilTimer.cancel();
+ if (scheduledFuture != null)
+ scheduledFuture.cancel(false);
}
/**
@@ -273,7 +281,8 @@
log.debug("stopTimer: " + this);
if (timerState != EXPIRED)
setTimerState(CANCELED);
- utilTimer.cancel();
+ if (scheduledFuture != null)
+ scheduledFuture.cancel(false);
}
/**
@@ -411,9 +420,6 @@
private void startInTx()
{
- // JBAS-4330, provide a meaningful name to the timer thread, needs jdk5+
- utilTimer = new Timer("EJB-Timer-" + timerId + timedObjectId);
-
if (timerService.getTransaction() != null)
{
// don't schedule the timeout yet
@@ -443,14 +449,17 @@
private void scheduleTimeout()
{
+ long initialDelay = nextExpire - System.currentTimeMillis();
+ if (initialDelay < 0)
+ initialDelay = 0;
if (periode > 0)
{
// schedule the periodic timer task
- utilTimer.schedule(new TimerTaskImpl(this), new Date(nextExpire), periode);
+ executor().scheduleAtFixedRate(new TimerTaskImpl(this), initialDelay, periode, MILLISECONDS);
}
else
{
- utilTimer.schedule(new TimerTaskImpl(this), new Date(nextExpire));
+ executor().schedule(new TimerTaskImpl(this), initialDelay, MILLISECONDS);
}
}
@@ -460,7 +469,7 @@
*/
private void triggerBacklogTimeoutNow()
{
- utilTimer.schedule(new TimerTaskImpl(this, true), new Date());
+ executor().schedule(new TimerTaskImpl(this, true), 0, MILLISECONDS);
}
/**
@@ -516,13 +525,32 @@
}
}
+ public void afterCompletion(int status)
+ {
+ // JBPAPP-8073: JBossTM won't say anything useful if afterCompletion fails
+ // TwoPhaseCoordinator.afterCompletion - returned failure for com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple at 3c255a5a
+ try
+ {
+ afterCompletion2(status);
+ }
+ catch (Throwable t)
+ {
+ log.error("Aftercompletion failed", t);
+ if (t instanceof RuntimeException)
+ throw (RuntimeException) t;
+ if (t instanceof Error)
+ throw (Error) t;
+ throw new RuntimeException(t);
+ }
+ }
+
/**
* This method is invoked after the transaction has committed or
* rolled back.
*
* @param status The status of the completed transaction.
*/
- public void afterCompletion(int status)
+ private void afterCompletion2(int status)
{
if (status == Status.STATUS_COMMITTED)
{
Modified: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/main/org/jboss/ejb/txtimer/TimerServiceImpl.java
===================================================================
--- branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/main/org/jboss/ejb/txtimer/TimerServiceImpl.java 2014-02-03 21:40:15 UTC (rev 114683)
+++ branches/JBPAPP_5_1_1_GA_JBPAPP-10980/server/src/main/org/jboss/ejb/txtimer/TimerServiceImpl.java 2014-02-03 21:52:57 UTC (rev 114684)
@@ -23,6 +23,14 @@
// $Id$
+import org.jboss.logging.Logger;
+
+import javax.ejb.EJBException;
+import javax.ejb.Timer;
+import javax.ejb.TimerHandle;
+import javax.transaction.SystemException;
+import javax.transaction.Transaction;
+import javax.transaction.TransactionManager;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
@@ -30,16 +38,11 @@
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledThreadPoolExecutor;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.atomic.AtomicInteger;
-import javax.ejb.EJBException;
-import javax.ejb.Timer;
-import javax.ejb.TimerHandle;
-import javax.transaction.SystemException;
-import javax.transaction.Transaction;
-import javax.transaction.TransactionManager;
-
-import org.jboss.logging.Logger;
-
/**
* The TimerService provides enterprise bean components with access to the
* container-provided Timer Service. The EJB Timer Service allows entity beans, stateless
@@ -74,6 +77,8 @@
// Map<TimerHandleImpl,TimerImpl>
private Map timers = new HashMap();
+ private final ScheduledExecutorService scheduledExecutorService;
+
// Constructors --------------------------------------------------
/**
@@ -82,16 +87,27 @@
* All the dependencies are supplied by the caller
*/
public TimerServiceImpl(
- TimedObjectId timedObjectId, TimedObjectInvoker timedObjectInvoker,
+ final TimedObjectId timedObjectId, TimedObjectInvoker timedObjectInvoker,
TransactionManager transactionManager, PersistencePolicy persistencePolicy,
- RetryPolicy retryPolicy, TimerIdGenerator timerIdGenerator)
+ RetryPolicy retryPolicy, TimerIdGenerator timerIdGenerator, int corePoolSize)
{
this.timedObjectId = timedObjectId;
this.timedObjectInvoker = timedObjectInvoker;
this.transactionManager = transactionManager;
this.persistencePolicy = persistencePolicy;
this.timerIdGenerator = timerIdGenerator;
- this.retryPolicy = retryPolicy;
+ this.retryPolicy = retryPolicy;
+ final AtomicInteger numThread = new AtomicInteger(0);
+ final ThreadFactory threadFactory = new ThreadFactory()
+ {
+ @Override
+ public Thread newThread(Runnable r)
+ {
+ // JBAS-4330, provide a meaningful name to the timer thread, needs jdk5+
+ return new Thread(r, "EJB-Timer-" + numThread.incrementAndGet() + " " + timedObjectId);
+ }
+ };
+ this.scheduledExecutorService = new ScheduledThreadPoolExecutor(corePoolSize, threadFactory);
}
// Public --------------------------------------------------------
@@ -107,6 +123,11 @@
}
}
+ ScheduledExecutorService getScheduledExecutorService()
+ {
+ return scheduledExecutorService;
+ }
+
/**
* Get the Timer for the given timedObjectId
*/
@@ -126,6 +147,8 @@
*/
public void shutdown(boolean keepState)
{
+ scheduledExecutorService.shutdown();
+ // TODO: should we await termination? If so, how long?
synchronized (timers)
{
Iterator it = timers.values().iterator();
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/system/src/main/org/jboss/system/server/profileservice/repository/AbstractBootstrapProfileFactory.java
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/system/src/resources/parsing-tests/common/profiles/clustering.profile
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/system/src/resources/parsing-tests/common/profiles/ejb3.profile
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/system/src/resources/parsing-tests/common/profiles/jboss-web.profile
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/system/src/resources/parsing-tests/config/profiles/default.profile
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/system/src/resources/parsing-tests/config/profiles/seam.profile
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/system/src/tests/org/jboss/test/server/profileservice/support/MavenProfileMetaData.java
___________________________________________________________________
Deleted: svn:mergeinfo
-
Modified: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/imports/sections/ejb3.xml
===================================================================
--- branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/imports/sections/ejb3.xml 2014-02-03 21:40:15 UTC (rev 114683)
+++ branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/imports/sections/ejb3.xml 2014-02-03 21:52:57 UTC (rev 114684)
@@ -222,6 +222,16 @@
</jar>
</target>
+ <target name="jbpapp8035" depends="compile">
+ <mkdir dir="${build.lib}"/>
+
+ <jar destfile="${build.lib}/jbpapp8035.jar">
+ <fileset dir="${build.classes}">
+ <include name="org/jboss/test/ejb3/jbpapp8035/**" />
+ </fileset>
+ </jar>
+ </target>
+
<target name="_jars-ejb3" depends="ejb3-servlet,jbas6161,jbas6239,ejbthree1597,jbas5713,
jbas7883,
ejb3iiop,
@@ -230,7 +240,8 @@
jbpapp2473,
jbpapp3026,
jbpapp4681,
- jboss51xsd">
+ jboss51xsd,
+ jbpapp8035">
<mkdir dir="${build.lib}" />
<!-- A jar with a simple ejb3 session -->
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/bootstrapdependencies/jbas5349/ejb2
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/bootstrapdependencies/jbas5349/ejb3
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/bootstrapdependencies/jbas5349/sar
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/bootstrapdependencies/jbas5349/servlet
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/bootstrapdependencies/jbas5349/test
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/classloader/leak/test/Ejb3ClassloaderLeakTestBase.java
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/classloader/leak/test/IsolatedEarWithDualCommonsLoggingClassloaderLeakTestCase.java
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/classloader/leak/test/J2EEClassloaderLeakTestBase.java
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/cluster/classloader/leak/test/FieldGranularityClassloaderLeakTestBase.java
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/cluster/classloader/leak/test/J2EEClassloaderLeakTestBase.java
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/YieldingGloballyExclusiveClusterLockSupportUnitTestCase.java
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/cluster/web/notification/SessionSpecListenerAttribute.java
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/ejb3/common/AbstractReplierMDB.java
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/ejb3/common/EJB3TestCase.java
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/ejb3/jbpapp2260/TransactionMDB.java
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/ejb3/jbpapp2260/unit
___________________________________________________________________
Deleted: svn:mergeinfo
-
Deleted: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/ejb3/jbpapp8035/TimerSample.java
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/jbpapp8035/TimerSample.java 2012-02-09 12:35:24 UTC (rev 112630)
+++ branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/ejb3/jbpapp8035/TimerSample.java 2014-02-03 21:52:57 UTC (rev 114684)
@@ -1,37 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright (c) 2012, Red Hat, Inc., and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.ejb3.jbpapp8035;
-
-import javax.ejb.Remote;
-import java.util.Date;
-
- at Remote
-public interface TimerSample {
- void cancelAllTimers();
- int getCount();
- void resetCount();
- void scheduleTimer(Date date);
- void scheduleTimer(long milliseconds);
- void scheduleTimer(long milliseconds, long period);
- void scheduleTimers(long number, long milliseconds);
- void scheduleTimerTxTimeout(long number);
-}
\ No newline at end of file
Copied: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/ejb3/jbpapp8035/TimerSample.java (from rev 112630, branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/jbpapp8035/TimerSample.java)
===================================================================
--- branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/ejb3/jbpapp8035/TimerSample.java (rev 0)
+++ branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/ejb3/jbpapp8035/TimerSample.java 2014-02-03 21:52:57 UTC (rev 114684)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright (c) 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ejb3.jbpapp8035;
+
+import javax.ejb.Remote;
+import java.util.Date;
+
+ at Remote
+public interface TimerSample {
+ void cancelAllTimers();
+ int getCount();
+ void resetCount();
+ void scheduleTimer(Date date);
+ void scheduleTimer(long milliseconds);
+ void scheduleTimer(long milliseconds, long period);
+ void scheduleTimers(long number, long milliseconds);
+ void scheduleTimerTxTimeout(long number);
+}
\ No newline at end of file
Deleted: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/ejb3/jbpapp8035/TimerSampleBean.java
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/jbpapp8035/TimerSampleBean.java 2012-02-09 12:35:24 UTC (rev 112630)
+++ branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/ejb3/jbpapp8035/TimerSampleBean.java 2014-02-03 21:52:57 UTC (rev 114684)
@@ -1,118 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright (c) 2012, Red Hat, Inc., and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.ejb3.jbpapp8035;
-
-import org.jboss.logging.Logger;
-
-import javax.annotation.Resource;
-import javax.ejb.SessionContext;
-import javax.ejb.Stateless;
-import javax.ejb.Timeout;
-import javax.ejb.Timer;
-import java.util.Date;
-import java.util.concurrent.atomic.AtomicInteger;
-
-/**
- * Sample Timer sample bean used by the unit test.
- * @author nicolasleroux
- */
- at Stateless
-public class TimerSampleBean implements TimerSample {
- @Resource
- private SessionContext ctx;
-
- private static AtomicInteger count = new AtomicInteger(0);
-
- public static final Logger log = Logger
- .getLogger(TimerSampleBean.class);
-
- public int getCount() {
- return count.intValue();
- }
-
- public void resetCount() {
- count.set(0);
- }
-
- public void scheduleTimer(long milliseconds) {
- log.info("scheduleTimer with initial duration " + milliseconds);
- ctx.getTimerService().createTimer(
- milliseconds, "Hello World");
- }
-
- public void scheduleTimer(long milliseconds, long period) {
- log.info("scheduleTimer with initial duration " + milliseconds + " and period " + period);
-
- ctx.getTimerService().createTimer(
- milliseconds, period, "Hello World repeat");
- }
-
- public void scheduleTimer(Date date) {
- log.info("scheduleTimer with date " + date);
-
- ctx.getTimerService().createTimer(
- date, "Hello World ");
- }
-
- public void scheduleTimerTxTimeout(long milliseconds) {
- log.info("scheduleTimer with initial duration " + milliseconds);
- ctx.getTimerService().createTimer(
- milliseconds, "Hello World ");
- try {
- Thread.sleep(300200);
- } catch(Exception e) {
- e.printStackTrace();
- }
- }
-
- public void cancelAllTimers() {
- // Cancel the timers
- for (Object t : ctx.getTimerService().getTimers()) {
- ((Timer)t).cancel();
- }
- }
-
- @Timeout
- public void timeoutHandler(Timer timer) {
- log.info("---------------------");
- log.info("* Received Timer event: " + timer.getInfo() + " in " + Thread.currentThread().getName());
- log.info("---------------------");
- sleep(100);
- count.incrementAndGet();
- }
-
- public void scheduleTimers(long number, long milliseconds) {
- for (int i = 0; i < number; i++) {
- log.info("scheduleTimer with initial duration " + milliseconds);
- ctx.getTimerService().createTimer(
- milliseconds, "Hello World");
- }
- }
-
- private static void sleep(final long millis) {
- try {
- Thread.sleep(millis);
- } catch (InterruptedException e) {
- // ignore
- }
- }
-}
Copied: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/ejb3/jbpapp8035/TimerSampleBean.java (from rev 112630, branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/jbpapp8035/TimerSampleBean.java)
===================================================================
--- branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/ejb3/jbpapp8035/TimerSampleBean.java (rev 0)
+++ branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/ejb3/jbpapp8035/TimerSampleBean.java 2014-02-03 21:52:57 UTC (rev 114684)
@@ -0,0 +1,118 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright (c) 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ejb3.jbpapp8035;
+
+import org.jboss.logging.Logger;
+
+import javax.annotation.Resource;
+import javax.ejb.SessionContext;
+import javax.ejb.Stateless;
+import javax.ejb.Timeout;
+import javax.ejb.Timer;
+import java.util.Date;
+import java.util.concurrent.atomic.AtomicInteger;
+
+/**
+ * Sample Timer sample bean used by the unit test.
+ * @author nicolasleroux
+ */
+ at Stateless
+public class TimerSampleBean implements TimerSample {
+ @Resource
+ private SessionContext ctx;
+
+ private static AtomicInteger count = new AtomicInteger(0);
+
+ public static final Logger log = Logger
+ .getLogger(TimerSampleBean.class);
+
+ public int getCount() {
+ return count.intValue();
+ }
+
+ public void resetCount() {
+ count.set(0);
+ }
+
+ public void scheduleTimer(long milliseconds) {
+ log.info("scheduleTimer with initial duration " + milliseconds);
+ ctx.getTimerService().createTimer(
+ milliseconds, "Hello World");
+ }
+
+ public void scheduleTimer(long milliseconds, long period) {
+ log.info("scheduleTimer with initial duration " + milliseconds + " and period " + period);
+
+ ctx.getTimerService().createTimer(
+ milliseconds, period, "Hello World repeat");
+ }
+
+ public void scheduleTimer(Date date) {
+ log.info("scheduleTimer with date " + date);
+
+ ctx.getTimerService().createTimer(
+ date, "Hello World ");
+ }
+
+ public void scheduleTimerTxTimeout(long milliseconds) {
+ log.info("scheduleTimer with initial duration " + milliseconds);
+ ctx.getTimerService().createTimer(
+ milliseconds, "Hello World ");
+ try {
+ Thread.sleep(300200);
+ } catch(Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void cancelAllTimers() {
+ // Cancel the timers
+ for (Object t : ctx.getTimerService().getTimers()) {
+ ((Timer)t).cancel();
+ }
+ }
+
+ @Timeout
+ public void timeoutHandler(Timer timer) {
+ log.info("---------------------");
+ log.info("* Received Timer event: " + timer.getInfo() + " in " + Thread.currentThread().getName());
+ log.info("---------------------");
+ sleep(100);
+ count.incrementAndGet();
+ }
+
+ public void scheduleTimers(long number, long milliseconds) {
+ for (int i = 0; i < number; i++) {
+ log.info("scheduleTimer with initial duration " + milliseconds);
+ ctx.getTimerService().createTimer(
+ milliseconds, "Hello World");
+ }
+ }
+
+ private static void sleep(final long millis) {
+ try {
+ Thread.sleep(millis);
+ } catch (InterruptedException e) {
+ // ignore
+ }
+ }
+}
Deleted: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/ejb3/jbpapp8035/unit/OverloadTimerServiceTestCase.java
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/jbpapp8035/unit/OverloadTimerServiceTestCase.java 2012-02-09 12:35:24 UTC (rev 112630)
+++ branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/ejb3/jbpapp8035/unit/OverloadTimerServiceTestCase.java 2014-02-03 21:52:57 UTC (rev 114684)
@@ -1,57 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright (c) 2012, Red Hat, Inc., and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.ejb3.jbpapp8035.unit;
-
-import junit.framework.Test;
-import org.jboss.test.ejb3.common.EJB3TestCase;
-import org.jboss.test.ejb3.jbpapp8035.TimerSample;
-
-/**
- * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
- */
-public class OverloadTimerServiceTestCase extends EJB3TestCase {
- private TimerSample bean;
-
- public OverloadTimerServiceTestCase(String name) {
- super(name);
- }
-
- public static Test suite() throws Exception {
- return getDeploySetup(OverloadTimerServiceTestCase.class, "jbpapp8035.jar");
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- bean = lookup("TimerSampleBean/remote", TimerSample.class);
- bean.cancelAllTimers();
- bean.resetCount();
- }
-
- public void testOverload() throws InterruptedException {
- bean.scheduleTimers(1000, 1);
- sleep(1000 * 100 / 50 + 1000);
- int result = bean.getCount();
- assertEquals(1000, result);
- }
-}
Copied: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/ejb3/jbpapp8035/unit/OverloadTimerServiceTestCase.java (from rev 112630, branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/ejb3/jbpapp8035/unit/OverloadTimerServiceTestCase.java)
===================================================================
--- branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/ejb3/jbpapp8035/unit/OverloadTimerServiceTestCase.java (rev 0)
+++ branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/ejb3/jbpapp8035/unit/OverloadTimerServiceTestCase.java 2014-02-03 21:52:57 UTC (rev 114684)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright (c) 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ejb3.jbpapp8035.unit;
+
+import junit.framework.Test;
+import org.jboss.test.ejb3.common.EJB3TestCase;
+import org.jboss.test.ejb3.jbpapp8035.TimerSample;
+
+/**
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ */
+public class OverloadTimerServiceTestCase extends EJB3TestCase {
+ private TimerSample bean;
+
+ public OverloadTimerServiceTestCase(String name) {
+ super(name);
+ }
+
+ public static Test suite() throws Exception {
+ return getDeploySetup(OverloadTimerServiceTestCase.class, "jbpapp8035.jar");
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ bean = lookup("TimerSampleBean/remote", TimerSample.class);
+ bean.cancelAllTimers();
+ bean.resetCount();
+ }
+
+ public void testOverload() throws InterruptedException {
+ bean.scheduleTimers(1000, 1);
+ sleep(1000 * 100 / 50 + 1000);
+ int result = bean.getCount();
+ assertEquals(1000, result);
+ }
+}
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/main/org/jboss/test/spring/test/SpringFacadeTestCase.java
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/testsuite/src/resources/bootstrapdependencies/jbas5349
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/tools/buildmagic/lib
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/varia/src/main/org/jboss/services/binding/ServiceBindingMetadata.java
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/varia/src/main/org/jboss/services/binding/managed/ServiceBindingMapper.java
___________________________________________________________________
Deleted: svn:mergeinfo
-
Property changes on: branches/JBPAPP_5_1_1_GA_JBPAPP-10980/varia/src/resources/seam/jboss-structure.xml
___________________________________________________________________
Deleted: svn:mergeinfo
-
More information about the jboss-cvs-commits
mailing list