[jboss-cvs] JBossAS SVN: r83919 - in branches/Branch_5_x: component-matrix and 6 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Feb 5 13:57:48 EST 2009
Author: wolfc
Date: 2009-02-05 13:57:48 -0500 (Thu, 05 Feb 2009)
New Revision: 83919
Added:
branches/Branch_5_x/ejb3/src/main/org/jboss/as/ejb3/
branches/Branch_5_x/ejb3/src/main/org/jboss/as/ejb3/timerservice/
branches/Branch_5_x/ejb3/src/main/org/jboss/as/ejb3/timerservice/JBossTimerServiceFactory.java
branches/Branch_5_x/ejb3/src/main/org/jboss/as/ejb3/timerservice/TimedObjectInvokerBridge.java
branches/Branch_5_x/ejb3/src/main/org/jboss/as/ejb3/timerservice/TimerServiceFacade.java
branches/Branch_5_x/ejb3/src/resources/ejb3-timerservice-jboss-beans.xml
Modified:
branches/Branch_5_x/build/build-distr.xml
branches/Branch_5_x/build/build.xml
branches/Branch_5_x/component-matrix/pom.xml
branches/Branch_5_x/ejb3/.classpath
branches/Branch_5_x/ejb3/build.xml
branches/Branch_5_x/thirdparty/pom.xml
Log:
JBAS-6430: upgrade to ejb3 1.1.0
Modified: branches/Branch_5_x/build/build-distr.xml
===================================================================
--- branches/Branch_5_x/build/build-distr.xml 2009-02-05 18:10:08 UTC (rev 83918)
+++ branches/Branch_5_x/build/build-distr.xml 2009-02-05 18:57:48 UTC (rev 83919)
@@ -138,17 +138,11 @@
<property name="_module.name" value="ejb3" override="true"/>
<property name="_module.output" override="true" value="${project.root}/${_module.name}/output"/>
- <mkdir dir="${install.examples.ejb3}"/>
- <copy todir="${install.examples.ejb3}" filtering="no">
- <fileset dir="${_module.output}/lib">
- <include name="ejb3-timer-service.xml"/>
- </fileset>
- </copy>
-
<copy todir="${install.server}/all/deploy" filtering="no">
- <fileset dir="${_module.output}/lib">
+ <fileset dir="${_module.output}/resources">
<include name="ejb3-container-jboss-beans.xml"/>
<include name="ejb3-interceptors-aop.xml"/>
+ <include name="ejb3-timerservice-jboss-beans.xml"/>
<include name="ejb3-connectors-jboss-beans.xml"/>
</fileset>
</copy>
@@ -185,6 +179,8 @@
excludes="*-sources.jar, *-javadoc.jar, *-client.jar, *-tests.jar"/>
<fileset dir="${jboss.jboss.ejb3.security.lib}" includes="*.jar"
excludes="*-sources.jar, *-javadoc.jar, *-client.jar, *-tests.jar"/>
+ <fileset dir="${jboss.jboss.ejb3.timerservice.spi.lib}" includes="*.jar"
+ excludes="*-sources.jar, *-javadoc.jar"/>
<fileset dir="${jboss.jboss.ejb3.transactions.lib}" includes="*.jar"
excludes="*-sources.jar, *-javadoc.jar"/>
<fileset dir="${hibernate.commons.annotations.lib}" includes="*.jar"
Modified: branches/Branch_5_x/build/build.xml
===================================================================
--- branches/Branch_5_x/build/build.xml 2009-02-05 18:10:08 UTC (rev 83918)
+++ branches/Branch_5_x/build/build.xml 2009-02-05 18:57:48 UTC (rev 83919)
@@ -230,7 +230,6 @@
<property name="install.jmx-api" value="${install.docs}/jmx-api"/>
<property name="install.todo" value="${install.docs}/todo"/>
<property name="install.examples" value="${install.docs}/examples"/>
- <property name="install.examples.ejb3" value="${install.docs}/examples/ejb3"/>
<property name="install.examples.jca" value="${install.docs}/examples/jca"/>
<property name="install.examples.jms" value="${install.docs}/examples/jms"/>
<property name="install.examples.jbossweb" value="${install.examples}/jbossweb"/>
Modified: branches/Branch_5_x/component-matrix/pom.xml
===================================================================
--- branches/Branch_5_x/component-matrix/pom.xml 2009-02-05 18:10:08 UTC (rev 83918)
+++ branches/Branch_5_x/component-matrix/pom.xml 2009-02-05 18:57:48 UTC (rev 83919)
@@ -51,9 +51,9 @@
<version.org.jboss.aspects.security>1.0.0.GA</version.org.jboss.aspects.security>
<version.org.jboss.aspects.transaction>1.0.0.GA</version.org.jboss.aspects.transaction>
<version.org.jboss.common.core>2.2.10.GA</version.org.jboss.common.core>
- <version.org.jboss.ejb3>1.0.0</version.org.jboss.ejb3>
+ <version.org.jboss.ejb3>1.1.0</version.org.jboss.ejb3>
<version.org.jboss.ejb3.common.client>1.0.0</version.org.jboss.ejb3.common.client>
- <version.org.jboss.ejb3.core.client>1.0.0</version.org.jboss.ejb3.core.client>
+ <version.org.jboss.ejb3.core.client>1.1.0</version.org.jboss.ejb3.core.client>
<version.org.jboss.ejb3.proxy.client>1.0.0</version.org.jboss.ejb3.proxy.client>
<version.org.jboss.ejb3.proxy.clustered.client>1.0.0</version.org.jboss.ejb3.proxy.clustered.client>
<version.org.jboss.ejb3.security.client>1.0.0</version.org.jboss.ejb3.security.client>
Modified: branches/Branch_5_x/ejb3/.classpath
===================================================================
--- branches/Branch_5_x/ejb3/.classpath 2009-02-05 18:10:08 UTC (rev 83918)
+++ branches/Branch_5_x/ejb3/.classpath 2009-02-05 18:57:48 UTC (rev 83919)
@@ -24,5 +24,6 @@
<classpathentry kind="lib" path="/thirdparty/jboss/jboss-ejb3-transactions/lib/jboss-ejb3-transactions.jar" sourcepath="/thirdparty/jboss/jboss-ejb3-transactions/lib/jboss-ejb3-transactions-sources.jar"/>
<classpathentry kind="lib" path="/thirdparty/jboss/jboss-ejb3-common/lib/jboss-ejb3-common.jar"/>
<classpathentry kind="lib" path="/thirdparty/jboss/jboss-ejb3-proxy/lib/jboss-ejb3-proxy.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jboss/jboss-ejb3-timerservice-spi/lib/jboss-ejb3-timerservice-spi.jar" sourcepath="/thirdparty/jboss/jboss-ejb3-timerservice-spi/lib/jboss-ejb3-timerservice-spi-sources.jar"/>
<classpathentry kind="output" path="output/eclipse-classes"/>
</classpath>
Modified: branches/Branch_5_x/ejb3/build.xml
===================================================================
--- branches/Branch_5_x/ejb3/build.xml 2009-02-05 18:10:08 UTC (rev 83918)
+++ branches/Branch_5_x/ejb3/build.xml 2009-02-05 18:57:48 UTC (rev 83919)
@@ -121,6 +121,7 @@
<path refid="jboss.jboss.ejb3.interceptors.classpath" />
<path refid="jboss.jboss.ejb3.metadata.classpath" />
<path refid="jboss.jboss.ejb3.proxy.classpath" />
+ <path refid="jboss.jboss.ejb3.timerservice.spi.classpath" />
<path refid="jboss.jboss.jpa.deployers.classpath"/>
<path refid="jboss.jboss.mdr.classpath"/>
<path refid="jboss.jboss.reflect.classpath" />
@@ -164,6 +165,7 @@
<property name="source.java" value="${module.source}/main"/>
<property name="source.etc" value="${module.source}/etc"/>
<property name="resources" value="${module.source}/resources"/>
+ <property name="source.resources" value="${module.source}/resources"/>
<!-- Where build generated files will go -->
<property name="build.reports" value="${module.output}/reports"/>
@@ -171,6 +173,7 @@
<property name="build.lib" value="${module.output}/lib"/>
<property name="build.api" value="${module.output}/api"/>
<property name="build.etc" value="${module.output}/etc"/>
+ <property name="build.resources" value="${module.output}/resources"/>
<!-- Install/Release structure -->
<property name="install.id" value="${module.name}-${module.version}"/>
@@ -236,7 +239,7 @@
<target name="compile"
description="Compile all source files."
- depends="compile-etc, compile-classes"/>
+ depends="compile-etc, compile-classes, compile-resources"/>
<!-- Compile all class files -->
<target name="compile-classes" depends="init">
@@ -259,6 +262,16 @@
</javac>
</target>
+ <!-- Compile resource files -->
+ <target name="compile-resources" depends="init">
+ <mkdir dir="${build.resources}"/>
+ <copy todir="${build.resources}" filtering="yes">
+ <fileset dir="${source.resources}">
+ <include name="**/*"/>
+ </fileset>
+ </copy>
+ </target>
+
<!-- Compile manifests -->
<target name="compile-etc" depends="init">
<mkdir dir="${build.etc}"/>
@@ -344,7 +357,6 @@
<copy todir="${build.lib}">
<fileset dir="output/resources">
<include name="ejb3-container-jboss-beans.xml"/>
- <include name="ejb3-timer-service.xml"/>
<include name="ejb3-connectors-jboss-beans.xml"/>
<include name="ejb3-interceptors-aop.xml"/>
</fileset>
Copied: branches/Branch_5_x/ejb3/src/main/org/jboss/as/ejb3/timerservice/JBossTimerServiceFactory.java (from rev 83558, projects/ejb3/trunk/timerservice-as5/src/main/java/org/jboss/ejb3/timerservice/as5/JBossTimerServiceFactory.java)
===================================================================
--- branches/Branch_5_x/ejb3/src/main/org/jboss/as/ejb3/timerservice/JBossTimerServiceFactory.java (rev 0)
+++ branches/Branch_5_x/ejb3/src/main/org/jboss/as/ejb3/timerservice/JBossTimerServiceFactory.java 2009-02-05 18:57:48 UTC (rev 83919)
@@ -0,0 +1,130 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, 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.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;
+import org.jboss.ejb3.timerservice.spi.TimerServiceFactory;
+import org.jboss.logging.Logger;
+import org.jboss.mx.util.MBeanProxyExt;
+import org.jboss.mx.util.MBeanServerLocator;
+
+/**
+ * Factory to create timer services which use the JBoss EJB Timer Service.
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class JBossTimerServiceFactory implements TimerServiceFactory
+{
+ private static Logger log = Logger.getLogger(JBossTimerServiceFactory.class);
+
+ public TimerService createTimerService(TimedObjectInvoker invoker)
+ {
+ TimerService timerService = null;
+ try
+ {
+ EJBTimerService service = getEJBTimerService();
+ ObjectName objectName = new ObjectName(invoker.getTimedObjectId());
+ org.jboss.ejb.txtimer.TimedObjectInvoker bridge = new TimedObjectInvokerBridge(invoker);
+ TimerService delegate = service.createTimerService(objectName, null, bridge);
+ timerService = new TimerServiceFacade(objectName, delegate);
+ }
+ catch (Exception e)
+ {
+ //throw new EJBException("Could not create timer service", e);
+ if (log.isTraceEnabled())
+ {
+ log.trace("Unable to initialize timer service", e);
+ }
+ else
+ {
+ log.trace("Unable to initialize timer service");
+ }
+ }
+ return timerService;
+ }
+
+ protected EJBTimerService getEJBTimerService()
+ {
+ return (EJBTimerService) MBeanProxyExt.create(EJBTimerService.class, EJBTimerService.OBJECT_NAME, MBeanServerLocator.locateJBoss());
+ }
+
+ public void removeTimerService(TimerService timerService)
+ {
+ removeTimerService(((TimerServiceFacade) timerService).getContainerId());
+ }
+
+ protected void removeTimerService(ObjectName containerId)
+ {
+ try
+ {
+ EJBTimerService service = getEJBTimerService();
+ service.removeTimerService(containerId, true);
+ }
+ 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");
+ }
+ }
+ }
+
+ public void restoreTimerService(TimerService aTimerService)
+ {
+ if (aTimerService == null)
+ {
+ log.warn("TIMER SERVICE IS NOT INSTALLED");
+ return;
+ }
+ TimerServiceFacade timerService = (TimerServiceFacade) aTimerService;
+ ClassLoader loader = null;
+
+ // FIXME: A hack to circumvent the check in TimerServiceFacade
+ // In AS itself (/EJB2) the container has an unsecured timer service association
+ // see org.jboss.ejb.Container.getTimerService(Object pKey)
+ AllowedOperationsAssociation.pushInMethodFlag(AllowedOperationsAssociation.IN_BUSINESS_METHOD);
+ try
+ {
+ getEJBTimerService().restoreTimers(timerService.getContainerId(), loader);
+ }
+ finally
+ {
+ AllowedOperationsAssociation.popInMethodFlag();
+ }
+ }
+
+ public void suspendTimerService(TimerService timerService)
+ {
+ removeTimerService(timerService);
+ }
+}
Copied: branches/Branch_5_x/ejb3/src/main/org/jboss/as/ejb3/timerservice/TimedObjectInvokerBridge.java (from rev 83558, projects/ejb3/trunk/timerservice-as5/src/main/java/org/jboss/ejb3/timerservice/as5/TimedObjectInvokerBridge.java)
===================================================================
--- branches/Branch_5_x/ejb3/src/main/org/jboss/as/ejb3/timerservice/TimedObjectInvokerBridge.java (rev 0)
+++ branches/Branch_5_x/ejb3/src/main/org/jboss/as/ejb3/timerservice/TimedObjectInvokerBridge.java 2009-02-05 18:57:48 UTC (rev 83919)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, 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.as.ejb3.timerservice;
+
+import javax.ejb.Timer;
+
+import org.jboss.ejb.txtimer.TimedObjectInvoker;
+
+/**
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class TimedObjectInvokerBridge implements TimedObjectInvoker
+{
+ private org.jboss.ejb3.timerservice.spi.TimedObjectInvoker delegate;
+
+ protected TimedObjectInvokerBridge(org.jboss.ejb3.timerservice.spi.TimedObjectInvoker delegate)
+ {
+ assert delegate != null : "delegate is null";
+ this.delegate = delegate;
+ }
+
+ public void callTimeout(Timer timer) throws Exception
+ {
+ delegate.callTimeout(timer);
+ }
+}
Copied: branches/Branch_5_x/ejb3/src/main/org/jboss/as/ejb3/timerservice/TimerServiceFacade.java (from rev 83558, projects/ejb3/trunk/timerservice-as5/src/main/java/org/jboss/ejb3/timerservice/as5/TimerServiceFacade.java)
===================================================================
--- branches/Branch_5_x/ejb3/src/main/org/jboss/as/ejb3/timerservice/TimerServiceFacade.java (rev 0)
+++ branches/Branch_5_x/ejb3/src/main/org/jboss/as/ejb3/timerservice/TimerServiceFacade.java 2009-02-05 18:57:48 UTC (rev 83919)
@@ -0,0 +1,101 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, 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.as.ejb3.timerservice;
+
+import static org.jboss.ejb.AllowedOperationsFlags.IN_BUSINESS_METHOD;
+import static org.jboss.ejb.AllowedOperationsFlags.IN_EJB_TIMEOUT;
+import static org.jboss.ejb.AllowedOperationsFlags.IN_SERVICE_ENDPOINT_METHOD;
+
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.Date;
+
+import javax.ejb.EJBException;
+import javax.ejb.Timer;
+import javax.ejb.TimerService;
+import javax.management.ObjectName;
+
+import org.jboss.ejb.AllowedOperationsAssociation;
+
+/**
+ * Holds the association with the container, without exposing it.
+ *
+ * @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class TimerServiceFacade implements TimerService
+{
+ private ObjectName objectName;
+ private TimerService delegate;
+
+ protected TimerServiceFacade(ObjectName objectName, TimerService delegate)
+ {
+ this.objectName = objectName;
+ this.delegate = delegate;
+ }
+
+ private void assertAllowedIn(String timerMethod)
+ {
+ // TODO: This isn't handled by the AS timer service itself
+ AllowedOperationsAssociation.assertAllowedIn(timerMethod, IN_BUSINESS_METHOD | IN_EJB_TIMEOUT | IN_SERVICE_ENDPOINT_METHOD);
+ }
+
+ public Timer createTimer(Date initialExpiration, long intervalDuration, Serializable info) throws IllegalArgumentException, IllegalStateException, EJBException
+ {
+ assertAllowedIn("TimerService.createTimer");
+ return delegate.createTimer(initialExpiration, intervalDuration, info);
+ }
+
+ public Timer createTimer(Date expiration, Serializable info) throws IllegalArgumentException, IllegalStateException, EJBException
+ {
+ assertAllowedIn("TimerService.createTimer");
+ return delegate.createTimer(expiration, info);
+ }
+
+ public Timer createTimer(long initialDuration, long intervalDuration, Serializable info) throws IllegalArgumentException, IllegalStateException, EJBException
+ {
+ assertAllowedIn("TimerService.createTimer");
+ return delegate.createTimer(initialDuration, intervalDuration, info);
+ }
+
+ public Timer createTimer(long duration, Serializable info) throws IllegalArgumentException, IllegalStateException, EJBException
+ {
+ assertAllowedIn("TimerService.createTimer");
+ return delegate.createTimer(duration, info);
+ }
+
+// protected EJBContainer getContainer()
+// {
+// return (EJBContainer) container;
+// }
+
+ protected ObjectName getContainerId()
+ {
+ return objectName;
+ }
+
+ public Collection<?> getTimers() throws IllegalStateException, EJBException
+ {
+ assertAllowedIn("TimerService.getTimers");
+ return delegate.getTimers();
+ }
+}
Copied: branches/Branch_5_x/ejb3/src/resources/ejb3-timerservice-jboss-beans.xml (from rev 83558, projects/ejb3/trunk/timerservice-as5/src/main/resources/META-INF/jboss-beans.xml)
===================================================================
--- branches/Branch_5_x/ejb3/src/resources/ejb3-timerservice-jboss-beans.xml (rev 0)
+++ branches/Branch_5_x/ejb3/src/resources/ejb3-timerservice-jboss-beans.xml 2009-02-05 18:57:48 UTC (rev 83919)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+ <bean name="JBossTimerServiceFactory" class="org.jboss.as.ejb3.timerservice.JBossTimerServiceFactory">
+ <depends>jboss.ejb:service=EJBTimerService</depends>
+ </bean>
+</deployment>
\ No newline at end of file
Modified: branches/Branch_5_x/thirdparty/pom.xml
===================================================================
--- branches/Branch_5_x/thirdparty/pom.xml 2009-02-05 18:10:08 UTC (rev 83918)
+++ branches/Branch_5_x/thirdparty/pom.xml 2009-02-05 18:57:48 UTC (rev 83919)
@@ -580,6 +580,13 @@
</dependency>
<dependency>
<groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-timerservice-spi</artifactId>
+ <mapping>
+ <componentId>jboss.jboss-ejb3-timerservice-spi</componentId>
+ </mapping>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.ejb3</groupId>
<artifactId>jboss-ejb3-transactions</artifactId>
<mapping>
<componentId>jboss.jboss-ejb3-transactions</componentId>
More information about the jboss-cvs-commits
mailing list