[jboss-cvs] JBossAS SVN: r57757 - in trunk: aspects aspects/src aspects/src/main/org/jboss/aop/deployment aspects/src/main/org/jboss/aspects aspects/src/main/org/jboss/aspects/asynch aspects/src/main/org/jboss/aspects/asynchronous/aspects/jboss aspects/src/main/org/jboss/aspects/concurrent aspects/src/main/org/jboss/aspects/dbc aspects/src/main/org/jboss/aspects/jmx aspects/src/main/org/jboss/aspects/patterns/readwritelock aspects/src/main/org/jboss/aspects/security aspects/src/main/org/jboss/aspects/tx aspects/src/main/org/jboss/aspects/txlock aspects/src/resources/META-INF build testsuite testsuite/imports/sections testsuite/src/jdk15/org/jboss/test testsuite/src/main/org/jboss/test/aop testsuite/src/main/org/jboss/test/aop/bean testsuite/src/main/org/jboss/test/aop/deployers testsuite/src/main/org/jboss/test/aop/deployers/annotations testsuite/src/main/org/jboss/test/aop/deployers/xml testsuite/src/main/org/jboss/test/aop/test thirdparty tools/etc/buildmagic
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Oct 20 12:26:17 EDT 2006
Author: kabir.khan at jboss.com
Date: 2006-10-20 12:25:45 -0400 (Fri, 20 Oct 2006)
New Revision: 57757
Added:
trunk/aspects/build-original.xml
trunk/aspects/src/main/org/jboss/aop/deployment/AspectManagerService32JDK5.java
trunk/aspects/src/main/org/jboss/aop/deployment/AspectManagerServiceJDK5.java
trunk/aspects/src/main/org/jboss/aspects/asynch/FutureImplJavaUtilConcurrent.java
trunk/aspects/src/main/org/jboss/aspects/concurrent/
trunk/aspects/src/main/org/jboss/aspects/concurrent/LatchAspect.java
trunk/aspects/src/main/org/jboss/aspects/concurrent/Latched.java
trunk/aspects/src/main/org/jboss/aspects/concurrent/LatchedObject.java
trunk/aspects/src/main/org/jboss/aspects/concurrent/LatchedObjectMixin.java
trunk/aspects/src/main/org/jboss/aspects/concurrent/LockAcquisitionFailureException.java
trunk/aspects/src/main/org/jboss/aspects/concurrent/MutexAspect.java
trunk/aspects/src/main/org/jboss/aspects/concurrent/MutexAspectFactory.java
trunk/aspects/src/main/org/jboss/aspects/concurrent/MutexLocked.java
trunk/aspects/src/main/org/jboss/aspects/concurrent/Mutexed.java
trunk/aspects/src/main/org/jboss/aspects/concurrent/MutexedMethod.java
trunk/aspects/src/main/org/jboss/aspects/concurrent/MutexedMethodAspect.java
trunk/aspects/src/main/org/jboss/aspects/concurrent/MutexedObject.java
trunk/aspects/src/main/org/jboss/aspects/concurrent/MutexedObjectMixin.java
trunk/aspects/src/main/org/jboss/aspects/concurrent/SemaphoreAspect.java
trunk/aspects/src/main/org/jboss/aspects/concurrent/SemaphoreLocked.java
trunk/aspects/src/main/org/jboss/aspects/concurrent/Semaphored.java
trunk/aspects/src/main/org/jboss/aspects/concurrent/SemaphoredMethod.java
trunk/aspects/src/main/org/jboss/aspects/concurrent/SemaphoredMethodAspect.java
trunk/aspects/src/main/org/jboss/aspects/concurrent/SemaphoredObject.java
trunk/aspects/src/main/org/jboss/aspects/concurrent/SemaphoredObjectMixin.java
trunk/aspects/src/resources/META-INF/aspect-deployer-beans.xml
trunk/testsuite/src/main/org/jboss/test/aop/deployers/
trunk/testsuite/src/main/org/jboss/test/aop/deployers/DeployersMonitor.java
trunk/testsuite/src/main/org/jboss/test/aop/deployers/DeployersMonitorMBean.java
trunk/testsuite/src/main/org/jboss/test/aop/deployers/annotations/
trunk/testsuite/src/main/org/jboss/test/aop/deployers/annotations/POJO.java
trunk/testsuite/src/main/org/jboss/test/aop/deployers/annotations/SomeAspect.java
trunk/testsuite/src/main/org/jboss/test/aop/deployers/annotations/SomeInterceptor.java
trunk/testsuite/src/main/org/jboss/test/aop/deployers/xml/
trunk/testsuite/src/main/org/jboss/test/aop/deployers/xml/POJO.java
trunk/testsuite/src/main/org/jboss/test/aop/deployers/xml/SomeAspect.java
trunk/testsuite/src/main/org/jboss/test/aop/deployers/xml/SomeInterceptor.java
trunk/testsuite/src/main/org/jboss/test/aop/test/DeployersInitialTestCase.java
Removed:
trunk/aspects/src/jdk15/
trunk/aspects/src/resources/META-INF/aspect-deployers-beans.xml
trunk/testsuite/src/jdk15/org/jboss/test/aop/
Modified:
trunk/aspects/.classpath
trunk/aspects/build.xml
trunk/aspects/src/main/org/jboss/aspects/Current.java
trunk/aspects/src/main/org/jboss/aspects/Injected.java
trunk/aspects/src/main/org/jboss/aspects/asynch/AsynchExecutor.java
trunk/aspects/src/main/org/jboss/aspects/asynch/Asynchronous.java
trunk/aspects/src/main/org/jboss/aspects/asynch/ThreadPoolExecutor.java
trunk/aspects/src/main/org/jboss/aspects/asynchronous/aspects/jboss/Asynchronous.java
trunk/aspects/src/main/org/jboss/aspects/dbc/Dbc.java
trunk/aspects/src/main/org/jboss/aspects/dbc/Invariant.java
trunk/aspects/src/main/org/jboss/aspects/dbc/PostCond.java
trunk/aspects/src/main/org/jboss/aspects/dbc/PreCond.java
trunk/aspects/src/main/org/jboss/aspects/dbc/StaticInvariant.java
trunk/aspects/src/main/org/jboss/aspects/jmx/MBean.java
trunk/aspects/src/main/org/jboss/aspects/patterns/readwritelock/readLockOperation.java
trunk/aspects/src/main/org/jboss/aspects/patterns/readwritelock/writeLockOperation.java
trunk/aspects/src/main/org/jboss/aspects/security/Exclude.java
trunk/aspects/src/main/org/jboss/aspects/security/Permissions.java
trunk/aspects/src/main/org/jboss/aspects/security/RunAs.java
trunk/aspects/src/main/org/jboss/aspects/security/SecurityDomain.java
trunk/aspects/src/main/org/jboss/aspects/security/Unchecked.java
trunk/aspects/src/main/org/jboss/aspects/tx/Tx.java
trunk/aspects/src/main/org/jboss/aspects/tx/TxLocal.java
trunk/aspects/src/main/org/jboss/aspects/tx/TxType.java
trunk/aspects/src/main/org/jboss/aspects/txlock/TxSynchronized.java
trunk/build/build-distr.xml
trunk/build/build-thirdparty.xml
trunk/testsuite/.classpath
trunk/testsuite/build.xml
trunk/testsuite/imports/sections/aop.xml
trunk/testsuite/src/main/org/jboss/test/aop/bean/AnnotatedSecuredPOJO.java
trunk/testsuite/src/main/org/jboss/test/aop/bean/AnnotatedTxLockedPOJO.java
trunk/testsuite/src/main/org/jboss/test/aop/bean/AnnotatedTxPOJO.java
trunk/testsuite/src/main/org/jboss/test/aop/bean/OverriddenAnnotation.java
trunk/thirdparty/.project
trunk/tools/etc/buildmagic/modules.ent
trunk/tools/etc/buildmagic/task.properties
Log:
Make aspects build jdk 5 only
Use new snapshot of aop split into aop14 and aop
Update testsuite to be built using jdk 5
Modified: trunk/aspects/.classpath
===================================================================
--- trunk/aspects/.classpath 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/.classpath 2006-10-20 16:25:45 UTC (rev 57757)
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry excluding="org/jboss/aop/microcontainer/prototype/AnnotationDependencyLister.java|org/jboss/aspects/Current.java|org/jboss/aspects/Injected.java|org/jboss/aspects/asynch/AsynchExecutor.java|org/jboss/aspects/asynch/Asynchronous.java|org/jboss/aspects/asynch/ThreadPoolExecutor.java|org/jboss/aspects/asynchronous/aspects/jboss/Asynchronous.java|org/jboss/aspects/dbc/Dbc.java|org/jboss/aspects/dbc/Invariant.java|org/jboss/aspects/dbc/PostCond.java|org/jboss/aspects/dbc/PreCond.java|org/jboss/aspects/dbc/StaticInvariant.java|org/jboss/aspects/jmx/MBean.java|org/jboss/aspects/patterns/readwritelock/readLockOperation.java|org/jboss/aspects/patterns/readwritelock/writeLockOperation.java|org/jboss/aspects/security/Exclude.java|org/jboss/aspects/security/Permissions.java|org/jboss/aspects/security/RunAs.java|org/jboss/aspects/security/SecurityDomain.java|org/jboss/aspects/security/Unchecked.java|org/jboss/aspects/tx/Tx.java|org/jboss/aspects/tx/TxLocal.java|org/jbos!
s/aspects/tx/TxType.java|org/jboss/aspects/txlock/TxSynchronized.java" kind="src" path="src/main"/>
- <classpathentry kind="src" path="src/jdk15"/>
+ <classpathentry kind="src" path="src/main"/>
<classpathentry kind="lib" path="src/resources"/>
<classpathentry excluding="org/jboss/test/aop/test/AOPTestSetup.java|org/jboss/test/asynch/" kind="src" path="src/test"/>
<classpathentry kind="src" path="src/test50"/>
Added: trunk/aspects/build-original.xml
===================================================================
--- trunk/aspects/build-original.xml 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/build-original.xml 2006-10-20 16:25:45 UTC (rev 57757)
@@ -0,0 +1,737 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE project [
+ <!ENTITY buildmagic SYSTEM "../tools/etc/buildmagic/buildmagic.ent">
+ <!ENTITY libraries SYSTEM "../thirdparty/libraries.ent">
+ <!ENTITY modules SYSTEM "../tools/etc/buildmagic/modules.ent">
+]>
+
+<!-- $Id: build.xml 57536 2006-10-10 15:17:43Z kabir.khan at jboss.com $ -->
+
+<!--+======================================================================+-->
+<!--| JBoss (The OpenSource J2EE WebOS) Build File |-->
+<!--| |-->
+<!--| Distributable under LGPL license. |-->
+<!--| See terms of license at http://www.gnu.org. |-->
+<!--| |-->
+<!--| This file has been designed to work with the 'tools' module and |-->
+<!--| Buildmagic extentions. |-->
+<!--+======================================================================+-->
+
+<project default="main" name="JBoss/Aspects">
+
+ <!--+====================================================================+-->
+ <!--| Setup |-->
+ <!--| |-->
+ <!--| Include the common build elements. |-->
+ <!--| |-->
+ <!--| This defines several different targets, properties and paths. |-->
+ <!--| It also sets up the basic extention tasks amoung other things. |-->
+ <!--+====================================================================+-->
+
+ &buildmagic;
+
+ <!-- ================================================================== -->
+ <!-- Initialization -->
+ <!-- ================================================================== -->
+
+ <!--
+ | Initialize the build system. Must depend on '_buildmagic:init'.
+ | Other targets should depend on 'init' or things will mysteriously fail.
+ -->
+
+ <target name="init" unless="init.disable" depends="_buildmagic:init">
+ </target>
+
+
+ <!--+====================================================================+-->
+ <!--| Configuration |-->
+ <!--| |-->
+ <!--| This target is invoked by the Buildmagic initialization logic |-->
+ <!--| and should contain module specific configuration elements. |-->
+ <!--+====================================================================+-->
+
+ <target name="configure" unless="configure.disable">
+ &libraries;
+ &modules;
+
+ <!-- Module name(s) & version -->
+ <property name="aspects.version" value="jboss-aspect-library-1.3"/>
+ <property name="aop.version" value="jboss-aop_1.3"/>
+ <property name="aspects.title" value="JBoss AOP Aspect Library"/>
+
+ <property name="module.name" value="aspects"/>
+ <property name="module.Name" value="JBoss Aspects"/>
+
+ <!-- Configure thirdparty libraries -->
+ <path id="library.classpath">
+ <path refid="qdox.classpath"/>
+ <path refid="javassist.classpath"/>
+ <path refid="trove.classpath"/>
+ <path refid="xdoclet.xdoclet.classpath"/>
+ <path refid="apache.ant.classpath"/>
+ <path refid="oswego.concurrent.classpath"/>
+ <path refid="junit.junit.classpath"/>
+ <path refid="apache.log4j.classpath"/>
+ <path refid="dom4j.dom4j.classpath"/>
+ <path refid="beanshell.beanshell.classpath"/>
+ <path refid="jboss.remoting.classpath"/>
+ <path refid="apache.xerces.classpath"/>
+ <path refid="jboss.microcontainer.classpath"/>
+ </path>
+
+ <!-- Configure modules -->
+ <path id="dependentmodule.classpath">
+ <path refid="jboss.common.core.classpath"/>
+ <path refid="jboss.common.logging.spi.classpath"/>
+ <path refid="jboss.common.logging.log4j.classpath"/>
+ <path refid="jboss.common.logging.jdk.classpath"/>
+ <path refid="jboss.j2ee.classpath"/>
+ <path refid="jboss.j2se.classpath"/>
+ <path refid="jboss.jmx.classpath"/>
+ <path refid="jboss.system.classpath"/>
+ <path refid="jboss.systemjmx.classpath"/>
+ <path refid="jboss.security.classpath"/>
+ <path refid="jboss.j2se.classpath"/>
+ <path refid="jboss.system.classpath"/>
+ <path refid="jboss.cluster.classpath"/>
+ <path refid="jboss.transaction.classpath"/>
+ <path refid="jboss.server.classpath"/>
+ <path refid="jboss.test.classpath"/>
+ </path>
+
+ <!-- ===== -->
+ <!-- Tasks -->
+ <!-- ===== -->
+
+ <!-- Where source files live -->
+ <property name="source.java" value="${module.source}/main"/>
+ <property name="source15.java" value="${module.source}/jdk15"/>
+ <property name="source.test" value="${module.source}/test"/>
+ <property name="source.etc" value="${module.source}/etc"/>
+ <property name="source.resources" value="${module.source}/resources"/>
+ <property name="source.bin" value="${module.source}/bin"/>
+
+ <!-- Where build generated files will go -->
+ <property name="build.reports" value="${module.output}/reports"/>
+ <property name="build.gen-src" value="${module.output}/gen-src"/>
+ <property name="build.classes" value="${module.output}/classes"/>
+ <property name="build.resources" value="${module.output}/resources"/>
+ <property name="build15.classes" value="${module.output}/classes15"/>
+ <property name="build.lib" value="${module.output}/lib"/>
+ <property name="build.unpacked" value="${module.output}/unpacked"/>
+ <property name="build.api" value="${module.output}/api"/>
+ <property name="build.etc" value="${module.output}/etc"/>
+ <property name="build.todo" value="${module.output}/todo"/>
+ <property name="build.meta.inf" value="${module.output}/META-INF"/>
+
+ <!-- Install/Release structure -->
+ <property name="install.id" value="${module.name}-${module.version}"/>
+ <property name="release.id" value="${install.id}"/>
+ <property name="install.root" value="${module.output}/${install.id}"/>
+
+ <!-- The combined thirdparty classpath -->
+ <path id="thirdparty.classpath">
+ <path refid="library.classpath"/>
+ <path refid="dependentmodule.classpath"/>
+ <!--path refid="apache.commons.classpath"/-->
+ </path>
+
+ <!-- classpath and local.classpath must have a value using with a path -->
+ <property name="classpath" value=""/>
+ <property name="local.classpath" value=""/>
+
+ <!-- The classpath required to build classes. -->
+ <path id="javac.classpath">
+ <pathelement path="${classpath}"/>
+ <pathelement path="${local.classpath}"/>
+ <path refid="thirdparty.classpath"/>
+ </path>
+
+ <!-- xdoclet -->
+ <path id="xdoclet.task.classpath">
+ <path refid="javac.classpath"/>
+ <fileset dir="${xdoclet.xdoclet.lib}">
+ <include name="**/*.jar"/>
+ </fileset>
+ </path>
+ <property name="xdoclet.task.classpath"
+ refid="xdoclet.task.classpath"/>
+
+ </target>
+
+
+ <!--+====================================================================+-->
+ <!--| Compile |-->
+ <!--| |-->
+ <!--| This target should depend on other compile-* targets for each |-->
+ <!--| different type of compile that needs to be performed, short of |-->
+ <!--| documentation compiles. |-->
+ <!--+====================================================================+-->
+
+ <target name="compile"
+ description="Compile all source files."
+ depends="_default:compile-etc, _default:compile-resources, compile-classes, compile-classes15">
+ <!-- Add module specific elements here. -->
+ </target>
+
+ <!-- Compile all class files -->
+ <target name="compile-classes">
+ <mkdir dir="${build.classes}"/>
+ <path id="javac14.classpath">
+ <path refid="javac.classpath"/>
+ <pathelement path="${jboss.aop.lib}/jboss-aop.jar"/>
+ <pathelement path="${jboss.aop.lib}/jdk14-pluggable-instrumentor.jar"/>
+ </path>
+ <javac destdir="${build.classes}"
+ optimize="${javac.optimize}"
+ target="${javac.target}"
+ source="${javac.source}"
+ debug="${javac.debug}"
+ depend="${javac.depend}"
+ verbose="${javac.verbose}"
+ deprecation="${javac.deprecation}"
+ includeAntRuntime="${javac.include.ant.runtime}"
+ includeJavaRuntime="${javac.include.java.runtime}"
+ includes="${javac.includes}"
+ excludes="${javac.excludes}"
+ failonerror="${javac.fail.onerror}">
+ <src path="${source.java}"/>
+ <classpath refid="javac14.classpath"/>
+ </javac>
+ </target>
+
+ <target name="compile-classes15" depends="init" if="HAVE_JDK_1.5">
+ <mkdir dir="${build15.classes}"/>
+ <path id="javac15.classpath">
+ <pathelement path="${build.classes}"/>
+ <pathelement path="${jboss.aop.lib}/jboss-aop-jdk50.jar"/>
+ <path refid="javac.classpath"/>
+ <pathelement path="${jboss.aop.lib}/pluggable-instrumentor.jar"/>
+ </path>
+ <javac destdir="${build15.classes}"
+ optimize="${javac.optimize}"
+ target="1.5"
+ source="1.5"
+ debug="${javac.debug}"
+ depend="${javac.depend}"
+ verbose="${javac.verbose}"
+ deprecation="${javac.deprecation}"
+ includeAntRuntime="${javac.include.ant.runtime}"
+ includeJavaRuntime="${javac.include.java.runtime}"
+ failonerror="${javac.fail.onerror}">
+ <src path="${source15.java}"/>
+ <classpath refid="javac15.classpath"/>
+ </javac>
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Generate Output |-->
+ <!--| |-->
+ <!--| Generates the target output for this module. Target output is |-->
+ <!--| the output which is ment to be released or used by external |-->
+ <!--| modules. |-->
+ <!--+====================================================================+-->
+
+ <target name="output"
+ description="Generate all target output."
+ depends="_buildmagic:build-bypass-check"
+ unless="build-bypass.on">
+
+ <call target="compile"/>
+
+ <mkdir dir="${build.lib}"/>
+
+ <!-- Build jboss-aspects.jar -->
+ <jar destfile="${build.lib}/jboss-aspect-library.jar" manifest="${build.etc}/default.mf"
+ update="${jar.update}" index="${jar.index}">
+ <fileset dir="${build.classes}">
+ <!-- Include everything else -->
+ <include name="org/jboss/**"/>
+ </fileset>
+ <fileset dir="${build.etc}">
+ <include name="org/jboss/**/*.xml"/>
+ </fileset>
+ <fileset dir="${build.resources}">
+ <include name="aop-deployer_1_1.xsd"/>
+ </fileset>
+ </jar>
+
+ <jar destfile="${build.lib}/jboss-aspect-library32.jar" manifest="${build.etc}/default.mf"
+ update="${jar.update}" index="${jar.index}">
+ <fileset dir="${build.classes}">
+ <!-- Include everything else -->
+ <include name="org/jboss/**"/>
+ </fileset>
+ <fileset dir="${build.etc}">
+ <include name="org/jboss/**/*.xml"/>
+ </fileset>
+ <zipfileset src="${jboss.common.core.lib}/jboss-common-core.jar">
+ <include name="org/jboss/util/file/ArchiveBrowser*.class"/>
+ <include name="org/jboss/util/file/ClassFileFilter.class"/>
+ <include name="org/jboss/util/file/DirectoryArchiveBrowser.class"/>
+ <include name="org/jboss/util/file/JarArchiveBrowser.class"/>
+ </zipfileset>
+ </jar>
+
+ <mkdir dir="${build.meta.inf}"/>
+ <copy file="${source.resources}/META-INF/jboss-service.xml" todir="${build.meta.inf}" filtering="true">
+ <filterset>
+ <filter token="SERVICE_NAME" value="org.jboss.aop.deployment.AspectManagerService"/>
+ </filterset>
+ </copy>
+ <jar destfile="${build.lib}/jboss-aop.deployer" manifest="${build.etc}/default.mf"
+ update="${jar.update}" index="${jar.index}">
+ <fileset file="${build.lib}/jboss-aspect-library.jar"/>
+ <fileset file="${jboss.aop.lib}/jboss-aop.jar"/>
+ <fileset file="${project.root}/aspects/src/etc/base-aop.xml"/>
+ <fileset file="${javassist.lib}/javassist.jar"/>
+ <fileset file="${trove.lib}/trove.jar"/>
+ <fileset dir="${module.output}" >
+ <include name="META-INF/jboss-service.xml"/>
+ </fileset>
+ </jar>
+ <delete dir="${build.meta.inf}"/>
+
+ <!-- Generate checksums -->
+ <call target="_default:compile-checksums"/>
+
+ </target>
+
+
+ <target name="jars15"
+ depends="compile-classes15" if="HAVE_JDK_1.5">
+
+ <mkdir dir="${build.lib}"/>
+
+ <!-- Build jboss-aspects-jdk50.jar -->
+ <jar destfile="${build.lib}/jboss-aspect-library-jdk50.jar" manifest="${build.etc}/default.mf"
+ update="${jar.update}" index="${jar.index}">
+ <fileset dir="${build.classes}">
+ <!-- Include everything else -->
+ <include name="org/jboss/**"/>
+ <exclude name="org.jboss.aop.microcontainer.prototype.AnnotationDependencyLister.class"/>
+ <exclude name="org/jboss/aspects/asynchronous/aspects/jboss/Asynchronous.class"/>
+ <exclude name="org/jboss/aspects/asynch/Asynchronous.class"/>
+ <exclude name="org/jboss/aspects/asynch/AsynchExecutor.class"/>
+ <exclude name="org/jboss/aspects/asynch/ThreadPoolExecutor*.class"/>
+ <exclude name="org/jboss/aspects/asynch/FutureImpl.class"/>
+ <exclude name="org/jboss/aspects/Current.class"/>
+ <exclude name="org/jboss/aspects/jmx/MBean.class"/>
+ <exclude name="org/jboss/test/**"/>
+ <exclude name="org/jboss/aspects/Injected.class"/>
+ <exclude name="org/jboss/aspects/dbc/Dbc.class"/>
+ <exclude name="org/jboss/aspects/dbc/Invariant.class"/>
+ <exclude name="org/jboss/aspects/dbc/PostCond.class"/>
+ <exclude name="org/jboss/aspects/dbc/PreCond.class"/>
+ <exclude name="org/jboss/aspects/dbc/StaticInvariant.class"/>
+ <exclude name="org/jboss/aspects/tx/TxType.class"/>
+ <exclude name="org/jboss/aspects/tx/Tx.class"/>
+ <exclude name="org/jboss/aspects/tx/TxLocal.class"/>
+ <exclude name="org/jboss/aspects/txlock/TxSynchronized.class"/>
+ <exclude name="org/jboss/aspects/security/SecurityDomain.class"/>
+ <exclude name="org/jboss/aspects/security/Exclude.class"/>
+ <exclude name="org/jboss/aspects/security/Unchecked.class"/>
+ <exclude name="org/jboss/aspects/security/RunAs.class"/>
+ <exclude name="org/jboss/aspects/security/Permissions.class"/>
+ <exclude name="org/jboss/aspects/patterns/readwritelock/readLockOperation.class"/>
+ <exclude name="org/jboss/aspects/patterns/readwritelock/writeLockOperation.class"/>
+ </fileset>
+ <fileset dir="${build15.classes}">
+ <include name="org/jboss/**"/>
+ </fileset>
+ <fileset dir="${build.etc}">
+ <include name="org/jboss/**/*.xml"/>
+ </fileset>
+ </jar>
+
+ <!-- Build client jar containing the minimum needed for ejb 3 -->
+ <jar destfile="${build.lib}/jboss-aspect-jdk50-client.jar" manifest="${build.etc}/default.mf"
+ update="${jar.update}" index="${jar.index}">
+ <fileset dir="${build.classes}">
+ <!-- Include everything else -->
+ <include name="org/jboss/aspects/asynch/AsynchProvider.class"/>
+ <include name="org/jboss/aspects/asynch/AsynchProxyInterceptor.class"/>
+ <include name="org/jboss/aspects/asynch/AsynchMixin.class"/>
+ <include name="org/jboss/aspects/asynch/Future.class"/>
+ <include name="org/jboss/aspects/asynch/FutureHolder.class"/>
+ <include name="org/jboss/aspects/asynch/FutureInvocationHandler.class"/>
+ <include name="org/jboss/aspects/asynch/RemotableFuture.class"/>
+ <include name="org/jboss/aspects/asynch/TimeoutException.class"/>
+ <include name="org/jboss/aspects/remoting/ClusterConstants.class"/>
+ <include name="org/jboss/aspects/remoting/ClusterChooserInterceptor.class"/>
+ <include name="org/jboss/aspects/remoting/FamilyWrapper.class"/>
+ <include name="org/jboss/aspects/remoting/InvokeRemoteInterceptor.class"/>
+ <include name="org/jboss/aspects/remoting/IsLocalInterceptor.class"/>
+ <include name="org/jboss/aspects/remoting/MergeMetaDataInterceptor.class"/>
+ <include name="org/jboss/aspects/remoting/PojiProxy.class"/>
+ <include name="org/jboss/aspects/tx/ClientTxPropagationInterceptor.class"/>
+ <include name="org/jboss/aspects/security/SecurityClientInterceptor.class"/>
+ <include name="org/jboss/aspects/security/SecurityActions*.class"/>
+ </fileset>
+ <fileset dir="${build15.classes}">
+ <include name="org/jboss/aspects/asynch/AsynchExecutor.class"/>
+ <include name="org/jboss/aspects/asynch/FutureImpl.class"/>
+ <include name="org/jboss/aspects/asynch/ThreadPoolExecutor*.class"/>
+ </fileset>
+ </jar>
+
+ <jar destfile="${build.lib}/jboss-aspect-library-jdk50-jb32.jar" manifest="${build.etc}/default.mf"
+ update="${jar.update}" index="${jar.index}">
+ <fileset dir="${build.classes}">
+ <!-- Include everything else -->
+ <include name="org/jboss/**"/>
+ <exclude name="org/jboss/aspects/asynchronous/aspects/jboss/Asynchronous.class"/>
+ <exclude name="org/jboss/aspects/asynch/Asynchronous.class"/>
+ <exclude name="org/jboss/aspects/asynch/AsynchExecutor.class"/>
+ <exclude name="org/jboss/aspects/asynch/ThreadPoolExecutor*.class"/>
+ <exclude name="org/jboss/aspects/asynch/FutureImpl.class"/>
+ <exclude name="org/jboss/aspects/Current.class"/>
+ <exclude name="org/jboss/aspects/jmx/MBean.class"/>
+ <exclude name="org/jboss/test/**"/>
+ <exclude name="org/jboss/aspects/Injected.class"/>
+ <exclude name="org/jboss/aspects/dbc/Dbc.class"/>
+ <exclude name="org/jboss/aspects/dbc/Invariant.class"/>
+ <exclude name="org/jboss/aspects/dbc/PostCond.class"/>
+ <exclude name="org/jboss/aspects/dbc/PreCond.class"/>
+ <exclude name="org/jboss/aspects/dbc/StaticInvariant.class"/>
+ <exclude name="org/jboss/aspects/tx/TxType.class"/>
+ <exclude name="org/jboss/aspects/tx/Tx.class"/>
+ <exclude name="org/jboss/aspects/tx/TxLocal.class"/>
+ <exclude name="org/jboss/aspects/txlock/TxSynchronized.class"/>
+ <exclude name="org/jboss/aspects/security/SecurityDomain.class"/>
+ <exclude name="org/jboss/aspects/security/Exclude.class"/>
+ <exclude name="org/jboss/aspects/security/Unchecked.class"/>
+ <exclude name="org/jboss/aspects/security/RunAs.class"/>
+ <exclude name="org/jboss/aspects/security/Permissions.class"/>
+ </fileset>
+ <fileset dir="${build15.classes}">
+ <include name="org/jboss/**"/>
+ </fileset>
+ <fileset dir="${build.etc}">
+ <include name="org/jboss/**/*.xml"/>
+ </fileset>
+ <zipfileset src="${jboss.common.core.lib}/jboss-common-core.jar">
+ <include name="org/jboss/util/file/ArchiveBrowser*.class"/>
+ <include name="org/jboss/util/file/ClassFileFilter.class"/>
+ <include name="org/jboss/util/file/DirectoryArchiveBrowser.class"/>
+ <include name="org/jboss/util/file/JarArchiveBrowser.class"/>
+ </zipfileset>
+ </jar>
+
+ <mkdir dir="${build.meta.inf}"/>
+ <copy file="${source.resources}/META-INF/aspect-deployers-beans.xml" todir="${build.meta.inf}"/>
+ <jar destfile="${build.lib}/jboss-aop-jdk50.deployer" manifest="${build.etc}/default.mf"
+ update="${jar.update}" index="${jar.index}">
+ <fileset file="${build.lib}/jboss-aspect-library-jdk50.jar"/>
+ <fileset file="${jboss.aop.lib}/jboss-aop-jdk50.jar"/>
+ <fileset file="${project.root}/aspects/src/etc/base-aop.xml"/>
+ <fileset file="${javassist.lib}/javassist.jar"/>
+ <fileset file="${trove.lib}/trove.jar"/>
+ <fileset dir="${module.output}">
+ <include name="META-INF/aspect-deployers-beans.xml"/>
+ </fileset>
+ </jar>
+ <delete dir="${build.meta.inf}"/>
+ </target>
+
+
+ <!-- ================================================================== -->
+ <!-- Cleaning -->
+ <!-- ================================================================== -->
+
+ <!-- Clean up all build output -->
+ <target name="clean"
+ description="Cleans up most generated files."
+ depends="_buildmagic:clean">
+ </target>
+
+ <!-- Clean up all generated files -->
+ <target name="clobber"
+ description="Cleans up all generated files."
+ depends="_buildmagic:clobber, clean">
+ </target>
+
+
+ <!-- ================================================================== -->
+ <!-- Install & Release -->
+ <!-- ================================================================== -->
+
+ <target name="dist" depends="javadocs, init">
+ <delete file="${aop.version}.zip"/>
+ <copy todir="docs" filtering="no">
+ <fileset dir="output">
+ <include name="api/**"/>
+ </fileset>
+ </copy>
+
+ <mkdir dir="${build.unpacked}"/>
+
+ <mkdir dir="${build.unpacked}/jboss-aop.deployer"/>
+ <unjar src="${build.lib}/jboss-aop.deployer"
+ dest="${build.unpacked}/jboss-aop.deployer"/>
+
+ <mkdir dir="${build.unpacked}/jboss-aop-jdk50.deployer"/>
+ <unjar src="${build.lib}/jboss-aop-jdk50.deployer"
+ dest="${build.unpacked}/jboss-aop-jdk50.deployer"/>
+
+
+ <zip zipfile="${aop.version}.zip">
+ <zipfileset dir="../aop/docs" prefix="${aop.version}/docs/aspect-framework">
+ <include name="api/**"/>
+ <include name="index.html"/>
+ <include name="misc/*.html"/>
+ <include name="misc/*.jpg"/>
+ <include name="examples/**"/>
+ <exclude name="**/CVS/**"/>
+ <exclude name="**/*.wiki"/>
+ </zipfileset>
+ <zipfileset dir="../aop/docs/reference/build" prefix="${aop.version}/docs/aspect-framework">
+ <include name="**/*"/>
+ <exclude name="**/CVS/**"/>
+ <exclude name="**/*.wiki"/>
+ </zipfileset>
+ <zipfileset dir="docs" prefix="${aop.version}/docs/aspect-library">
+ <include name="api/**"/>
+ <include name="**/*.html"/>
+ <include name="**/*.jpg"/>
+ <include name="examples/**"/>
+ <exclude name="**/CVS/**"/>
+ <exclude name="**/*.wiki"/>
+ </zipfileset>
+ <zipfileset dir="${build.unpacked}" prefix="${aop.version}/jboss-40-install">
+ <include name="**/*"/>
+ </zipfileset>
+ <zipfileset dir="${build.lib}" prefix="${aop.version}/lib">
+ <include name="jboss-aspect-library.jar"/>
+ </zipfileset>
+ <zipfileset dir="${jboss.aop.lib}" prefix="${aop.version}/lib">
+ <include name="jdk14-pluggable-instrumentor.jar"/>
+ <include name="jrockit-pluggable-instrumentor.jar"/>
+ <include name="jboss-aop.jar"/>
+ </zipfileset>
+ <zipfileset dir="${javassist.lib}" prefix="${aop.version}/lib">
+ <include name="javassist.jar"/>
+ </zipfileset>
+ <zipfileset dir="${trove.lib}" prefix="${aop.version}/lib">
+ <include name="trove.jar"/>
+ </zipfileset>
+ <zipfileset dir="${qdox.qdox.lib}" prefix="${aop.version}/lib">
+ <include name="qdox.jar"/>
+ </zipfileset>
+ <zipfileset dir="${jboss.common.lib}" prefix="${aop.version}/lib">
+ <include name="jboss-common.jar"/>
+ </zipfileset>
+ <zipfileset dir="${oswego.concurrent.lib}" prefix="${aop.version}/lib">
+ <include name="concurrent.jar"/>
+ </zipfileset>
+ <zipfileset dir="${beanshell.beanshell.lib}" prefix="${aop.version}/lib">
+ <include name="bsh-1.3.0.jar"/>
+ </zipfileset>
+
+ <zipfileset dir="${build.lib}" prefix="${aop.version}/jboss-32-install-jdk5">
+ <include name="jboss-aspect-library-jdk50-jb32.jar"/>
+ </zipfileset>
+ <zipfileset dir="${jboss.aop.lib}" prefix="${aop.version}/jboss-32-install-jdk5">
+ <include name="jboss-aop-jdk50.jar"/>
+ </zipfileset>
+ <zipfileset dir="${javassist.lib}" prefix="${aop.version}/jboss-32-install-jdk5">
+ <include name="javassist.jar"/>
+ </zipfileset>
+ <zipfileset dir="${trove.lib}" prefix="${aop.version}/jboss-32-install-jdk5">
+ <include name="trove.jar"/>
+ </zipfileset>
+
+
+ <zipfileset dir="${build.lib}" prefix="${aop.version}/jboss-32-install">
+ <include name="jboss-aspect-library32.jar"/>
+ </zipfileset>
+ <zipfileset dir="${jboss.aop.lib}" prefix="${aop.version}/jboss-32-install">
+ <include name="jboss-aop.jar"/>
+ </zipfileset>
+ <zipfileset dir="${javassist.lib}" prefix="${aop.version}/jboss-32-install">
+ <include name="javassist.jar"/>
+ </zipfileset>
+ <zipfileset dir="${trove.lib}" prefix="${aop.version}/jboss-32-install">
+ <include name="trove.jar"/>
+ </zipfileset>
+
+ <zipfileset dir="${build.lib}" prefix="${aop.version}/lib-50">
+ <include name="jboss-aspect-library-jdk50.jar"/>
+ <include name="jboss-aspect-jdk50-client.jar"/>
+ </zipfileset>
+ <zipfileset dir="${jboss.aop.lib}" prefix="${aop.version}/lib-50">
+ <include name="jboss-aop-jdk50.jar"/>
+ <include name="pluggable-instrumentor.jar"/>
+ <include name="jboss-aop-jdk50-client.jar"/>
+ <include name="jrockit-pluggable-instrumentor.jar"/>
+ </zipfileset>
+ <zipfileset dir="${javassist.lib}" prefix="${aop.version}/lib-50">
+ <include name="javassist.jar"/>
+ </zipfileset>
+ <zipfileset dir="${trove.lib}" prefix="${aop.version}/lib-50">
+ <include name="trove.jar"/>
+ </zipfileset>
+ <zipfileset dir="${qdox.qdox.lib}" prefix="${aop.version}/lib-50">
+ <include name="qdox.jar"/>
+ </zipfileset>
+ <zipfileset dir="${jboss.common.lib}" prefix="${aop.version}/lib-50">
+ <include name="jboss-common.jar"/>
+ </zipfileset>
+ <zipfileset dir="${oswego.concurrent.lib}" prefix="${aop.version}/lib-50">
+ <include name="concurrent.jar"/>
+ </zipfileset>
+ <zipfileset dir="${beanshell.beanshell.lib}" prefix="${aop.version}/lib-50">
+ <include name="bsh-1.3.0.jar"/>
+ </zipfileset>
+
+ <zipfileset dir="../aop/src/resources/bin" prefix="${aop.version}/bin">
+ <include name="*.sh"/>
+ <include name="*.bat"/>
+ <exclude name="**/CVS/**"/>
+ </zipfileset>
+ <zipfileset file="src/etc/base-aop.xml" prefix="${aop.version}/etc"/>
+ <zipfileset file="RELEASE_NOTES.html" prefix="${aop.version}"/>
+ <zipfileset dir="src" prefix="${aop.version}/src/aspect-library">
+ <include name="jdk15/**/*.java"/>
+ <include name="main/**/*.java"/>
+ <include name="main/**/*.xml"/>
+ <include name="test/**/*.java"/>
+ <include name="test/**/*.xml"/>
+ <include name="resources/**/*.xml"/>
+ <exclude name="**/CVS/**"/>
+ </zipfileset>
+ <zipfileset dir="../aop/src" prefix="${aop.version}/src/aspect-framework">
+ <include name="jdk15/**/*.java"/>
+ <include name="main/**/*.java"/>
+ <include name="main/**/*.xml"/>
+ <include name="test/**/*.java"/>
+ <include name="test/**/*.xml"/>
+ <include name="resources/**/*.xml"/>
+ <exclude name="**/CVS/**"/>
+ </zipfileset>
+ </zip>
+ </target>
+
+ <!-- ================================================================== -->
+ <!-- Misc. -->
+ <!-- ================================================================== -->
+
+ <target name="main"
+ description="Executes the default target (most)."
+ depends="most"/>
+
+ <target name="all"
+ description="Builds everything."
+ depends="output, jars15, docs"/>
+
+ <target name="most"
+ description="Builds almost everything."
+ depends="output, jars15"/>
+
+ <target name="help"
+ description="Show this help message."
+ depends="_buildmagic:help:standard"/>
+
+ <!--
+ <target name="run-ioc-example" depends="compile">
+ <taskdef name="aopc" classname="org.jboss.aop.ant.AopC" classpathref="jboss.aop.classpath"/>
+ <aopc compilerclasspathref="javac.classpath">
+ <classpath refid="jboss.aop.classpath"/>
+ <classpath refid="javac.classpath"/>
+ <classpath path="${build.classes}"/>
+ <src path="${build.classes}"/>
+ <include name="test/ioc/POJO.class"/>
+ <aoppath path="${source.test}/test/ioc/META-INF/jboss-aop.xml"/>
+ </aopc>
+ <java fork="yes" failOnError="true" className="test.ioc.IocTest">
+ <sysproperty key="java.system.class.loader" value="org.jboss.aop.standalone.SystemClassLoader"/>
+ <sysproperty key="jboss.aop.path" value="src/test/test/ioc/META-INF/jboss-aop.xml"/>
+ <classpath refid="javac.classpath"/>
+ <classpath path="${build.classes}"/>
+ </java>
+ </target>
+ -->
+
+ <target name="run-asynch-aspect" depends="compile">
+ <taskdef name="aopc" classname="org.jboss.aop.ant.AopC" classpathref="jboss.aop.classpath"/>
+ <taskdef name="annotationc" classname="org.jboss.aop.ant.AnnotationC" classpathref="jboss.aop.classpath"/>
+
+ <path id="annotationc.classpath">
+ <path location="${build.classes}"/>
+ <path refid="jboss.aop.classpath"/>
+ </path>
+ <annotationc compilerclasspathref="javac.classpath" classpathref="annotationc.classpath" bytecode="true">
+ <src path="src/test/test/asynchronous"/>
+ </annotationc>
+
+ <junit printsummary="yes" fork="yes" haltonfailure="yes">
+ <sysproperty key="java.system.class.loader" value="org.jboss.aop.standalone.SystemClassLoader"/>
+ <sysproperty key="jboss.aop.path" value="src/test/test/asynchronous/META-INF/jboss-aop.xml"/>
+ <classpath refid="javac.classpath"/>
+ <classpath path="${build.classes}"/>
+ <formatter type="plain"/>
+ <test fork="yes" name="test.asynchronous.JUnitTestAsynchronousAspects"/>
+ </junit>
+
+ </target>
+
+
+ <target name="run-readwritelock-aspect" depends="compile">
+ <taskdef name="aopc" classname="org.jboss.aop.ant.AopC" classpathref="jboss.aop.classpath"/>
+ <taskdef name="annotationc" classname="org.jboss.aop.ant.AnnotationC" classpathref="jboss.aop.classpath"/>
+
+ <path id="annotationc.classpath">
+ <path location="${build.classes}"/>
+ </path>
+ <annotationc compilerclasspathref="javac.classpath" classpathref="annotationc.classpath" bytecode="true">
+ <src path="src/test/."/>
+ </annotationc>
+
+ <aopc compilerclasspathref="javac.classpath">
+ <classpath refid="javac.classpath"/>
+ <classpath path="${build.classes}"/>
+ <src path="${build.classes}"/>
+ <aoppath path="${source.test}/test/patterns/readwritelock/META-INF/jboss-aop.xml"/>
+ </aopc>
+
+ <junit printsummary="yes" fork="no" haltonfailure="yes">
+
+ <sysproperty key="jboss.aop.path" value="src/test/test/patterns/readwritelock/META-INF/jboss-aop.xml"/>
+ <classpath refid="javac.classpath"/>
+ <classpath path="${build.classes}"/>
+ <formatter type="plain"/>
+ <test fork="yes" name="test.patterns.readwritelock.JUnitTestReadWriteLockAspects"/>
+ </junit>
+
+ </target>
+
+ <target name="run-dbc-aspect" depends="compile">
+ <taskdef name="aopc" classname="org.jboss.aop.ant.AopC" classpathref="jboss.aop.classpath"/>
+ <taskdef name="annotationc" classname="org.jboss.aop.ant.AnnotationC" classpathref="jboss.aop.classpath"/>
+
+ <path id="annotationc.classpath">
+ <path location="${build.classes}"/>
+ </path>
+ <annotationc compilerclasspathref="javac.classpath" classpathref="annotationc.classpath" bytecode="true">
+ <src path="src/test/."/>
+ </annotationc>
+
+ <aopc compilerclasspathref="javac.classpath">
+ <classpath refid="javac.classpath"/>
+ <classpath path="${build.classes}"/>
+ <src path="${build.classes}"/>
+ <aoppath path="${source.test}/test/dbc/META-INF/jboss-aop.xml"/>
+ </aopc>
+
+ <junit printsummary="yes" fork="no" haltonfailure="yes">
+
+ <sysproperty key="jboss.aop.path" value="src/test/test/dbc/META-INF/jboss-aop.xml"/>
+ <classpath refid="javac.classpath"/>
+ <classpath path="${build.classes}"/>
+ <formatter type="plain"/>
+ <test fork="yes" name="test.dbc.DbcTest"/>
+ </junit>
+
+ </target>
+
+</project>
Modified: trunk/aspects/build.xml
===================================================================
--- trunk/aspects/build.xml 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/build.xml 2006-10-20 16:25:45 UTC (rev 57757)
@@ -67,7 +67,6 @@
<path refid="qdox.classpath"/>
<path refid="javassist.classpath"/>
<path refid="trove.classpath"/>
- <path refid="xdoclet.xdoclet.classpath"/>
<path refid="apache.ant.classpath"/>
<path refid="oswego.concurrent.classpath"/>
<path refid="junit.junit.classpath"/>
@@ -77,14 +76,16 @@
<path refid="jboss.remoting.classpath"/>
<path refid="apache.xerces.classpath"/>
<path refid="jboss.microcontainer.classpath"/>
+ <path refid="jboss.aop.classpath"/>
+ <path refid="jboss.test.classpath"/>
</path>
<!-- Configure modules -->
<path id="dependentmodule.classpath">
- <path refid="jboss.common.core.classpath"/>
- <path refid="jboss.common.logging.spi.classpath"/>
- <path refid="jboss.common.logging.log4j.classpath"/>
- <path refid="jboss.common.logging.jdk.classpath"/>
+ <path refid="jboss.common.core.classpath"/>
+ <path refid="jboss.common.logging.spi.classpath"/>
+ <path refid="jboss.common.logging.log4j.classpath"/>
+ <path refid="jboss.common.logging.jdk.classpath"/>
<path refid="jboss.j2ee.classpath"/>
<path refid="jboss.j2se.classpath"/>
<path refid="jboss.jmx.classpath"/>
@@ -96,7 +97,6 @@
<path refid="jboss.cluster.classpath"/>
<path refid="jboss.transaction.classpath"/>
<path refid="jboss.server.classpath"/>
- <path refid="jboss.test.classpath"/>
</path>
<!-- ===== -->
@@ -105,7 +105,7 @@
<!-- Where source files live -->
<property name="source.java" value="${module.source}/main"/>
- <property name="source15.java" value="${module.source}/jdk15"/>
+<!--property name="source15.java" value="${module.source}/jdk15"/-->
<property name="source.test" value="${module.source}/test"/>
<property name="source.etc" value="${module.source}/etc"/>
<property name="source.resources" value="${module.source}/resources"/>
@@ -115,8 +115,9 @@
<property name="build.reports" value="${module.output}/reports"/>
<property name="build.gen-src" value="${module.output}/gen-src"/>
<property name="build.classes" value="${module.output}/classes"/>
+ <property name="build.classes.retro" value="${module.output}/classes-retro"/>
<property name="build.resources" value="${module.output}/resources"/>
- <property name="build15.classes" value="${module.output}/classes15"/>
+<!--property name="build15.classes" value="${module.output}/classes15"/-->
<property name="build.lib" value="${module.output}/lib"/>
<property name="build.unpacked" value="${module.output}/unpacked"/>
<property name="build.api" value="${module.output}/api"/>
@@ -142,11 +143,23 @@
<!-- The classpath required to build classes. -->
<path id="javac.classpath">
+ <path refid="jboss.aop.classpath"/>
<pathelement path="${classpath}"/>
<pathelement path="${local.classpath}"/>
<path refid="thirdparty.classpath"/>
</path>
+ <path id="javac15.classpath">
+ <pathelement path="${build.classes}"/>
+ <path refid="javac.classpath"/>
+ </path>
+ <path id="jbossretro.classpath">
+ <path refid="apache.ant.classpath"/>
+ <path refid="javassist.classpath"/>
+ <path refid="jboss.jbossretro.classpath"/>
+ <path refid="jboss.backport.concurrent.classpath"/>
+ </path>
+
<!-- xdoclet -->
<path id="xdoclet.task.classpath">
<path refid="javac.classpath"/>
@@ -170,18 +183,13 @@
<target name="compile"
description="Compile all source files."
- depends="_default:compile-etc, _default:compile-resources, compile-classes, compile-classes15">
+ depends="_default:compile-etc, _default:compile-resources, compile-classes, retrotranslate">
<!-- Add module specific elements here. -->
</target>
<!-- Compile all class files -->
<target name="compile-classes">
<mkdir dir="${build.classes}"/>
- <path id="javac14.classpath">
- <path refid="javac.classpath"/>
- <pathelement path="${jboss.aop.lib}/jboss-aop.jar"/>
- <pathelement path="${jboss.aop.lib}/jdk14-pluggable-instrumentor.jar"/>
- </path>
<javac destdir="${build.classes}"
optimize="${javac.optimize}"
target="${javac.target}"
@@ -196,34 +204,25 @@
excludes="${javac.excludes}"
failonerror="${javac.fail.onerror}">
<src path="${source.java}"/>
- <classpath refid="javac14.classpath"/>
+ <classpath refid="javac.classpath"/>
</javac>
</target>
- <target name="compile-classes15" depends="init" if="HAVE_JDK_1.5">
- <mkdir dir="${build15.classes}"/>
- <path id="javac15.classpath">
- <pathelement path="${build.classes}"/>
- <pathelement path="${jboss.aop.lib}/jboss-aop-jdk50.jar"/>
- <path refid="javac.classpath"/>
- <pathelement path="${jboss.aop.lib}/pluggable-instrumentor.jar"/>
- </path>
- <javac destdir="${build15.classes}"
- optimize="${javac.optimize}"
- target="1.5"
- source="1.5"
- debug="${javac.debug}"
- depend="${javac.depend}"
- verbose="${javac.verbose}"
- deprecation="${javac.deprecation}"
- includeAntRuntime="${javac.include.ant.runtime}"
- includeJavaRuntime="${javac.include.java.runtime}"
- failonerror="${javac.fail.onerror}">
- <src path="${source15.java}"/>
+ <target name="retrotranslate" depends="compile-classes">
+ <mkdir dir="${build.classes.retro}"/>
+
+ <taskdef name="retro" classname="org.jboss.ant.tasks.retro.Retro" classpathref="jbossretro.classpath"/>
+ <retro compilerclasspathref="jbossretro.classpath" destdir="${build.classes.retro}">
+ <classpath refid="jbossretro.classpath"/>
<classpath refid="javac15.classpath"/>
- </javac>
+ <classpath>
+ <pathelement path="${build.classes}"/>
+ </classpath>
+ <src path="${build.classes}"/>
+ </retro>
</target>
+
<!--+====================================================================+-->
<!--| Generate Output |-->
<!--| |-->
@@ -241,8 +240,8 @@
<mkdir dir="${build.lib}"/>
- <!-- Build jboss-aspects.jar -->
- <jar destfile="${build.lib}/jboss-aspect-library.jar" manifest="${build.etc}/default.mf"
+ <!-- Build jboss-aspects-jdk50.jar -->
+ <jar destfile="${build.lib}/jboss-aspect-library-jdk50.jar" manifest="${build.etc}/default.mf"
update="${jar.update}" index="${jar.index}">
<fileset dir="${build.classes}">
<!-- Include everything else -->
@@ -251,16 +250,41 @@
<fileset dir="${build.etc}">
<include name="org/jboss/**/*.xml"/>
</fileset>
- <fileset dir="${build.resources}">
- <include name="aop-deployer_1_1.xsd"/>
+ </jar>
+
+ <!-- Build client jar containing the minimum needed for ejb 3 -->
+ <jar destfile="${build.lib}/jboss-aspect-jdk50-client.jar" manifest="${build.etc}/default.mf"
+ update="${jar.update}" index="${jar.index}">
+ <fileset dir="${build.classes}">
+ <!-- Include everything else -->
+ <include name="org/jboss/aspects/asynch/AsynchExecutor.class"/>
+ <include name="org/jboss/aspects/asynch/AsynchProvider.class"/>
+ <include name="org/jboss/aspects/asynch/AsynchProxyInterceptor.class"/>
+ <include name="org/jboss/aspects/asynch/AsynchMixin.class"/>
+ <include name="org/jboss/aspects/asynch/Future.class"/>
+ <include name="org/jboss/aspects/asynch/FutureImpl.class"/>
+ <include name="org/jboss/aspects/asynch/FutureHolder.class"/>
+ <include name="org/jboss/aspects/asynch/FutureInvocationHandler.class"/>
+ <include name="org/jboss/aspects/asynch/RemotableFuture.class"/>
+ <include name="org/jboss/aspects/asynch/TimeoutException.class"/>
+ <include name="org/jboss/aspects/asynch/ThreadPoolExecutor*.class"/>
+ <include name="org/jboss/aspects/remoting/ClusterConstants.class"/>
+ <include name="org/jboss/aspects/remoting/ClusterChooserInterceptor.class"/>
+ <include name="org/jboss/aspects/remoting/FamilyWrapper.class"/>
+ <include name="org/jboss/aspects/remoting/InvokeRemoteInterceptor.class"/>
+ <include name="org/jboss/aspects/remoting/IsLocalInterceptor.class"/>
+ <include name="org/jboss/aspects/remoting/MergeMetaDataInterceptor.class"/>
+ <include name="org/jboss/aspects/remoting/PojiProxy.class"/>
+ <include name="org/jboss/aspects/tx/ClientTxPropagationInterceptor.class"/>
+ <include name="org/jboss/aspects/security/SecurityClientInterceptor.class"/>
+ <include name="org/jboss/aspects/security/SecurityActions.class"/>
</fileset>
</jar>
- <jar destfile="${build.lib}/jboss-aspect-library32.jar" manifest="${build.etc}/default.mf"
+ <jar destfile="${build.lib}/jboss-aspect-library-jdk50-jb32.jar" manifest="${build.etc}/default.mf"
update="${jar.update}" index="${jar.index}">
<fileset dir="${build.classes}">
<!-- Include everything else -->
- <include name="org/jboss/**"/>
</fileset>
<fileset dir="${build.etc}">
<include name="org/jboss/**/*.xml"/>
@@ -276,137 +300,61 @@
<mkdir dir="${build.meta.inf}"/>
<copy file="${source.resources}/META-INF/jboss-service.xml" todir="${build.meta.inf}" filtering="true">
<filterset>
- <filter token="SERVICE_NAME" value="org.jboss.aop.deployment.AspectManagerService"/>
+ <filter token="SERVICE_NAME" value="org.jboss.aop.deployment.AspectManagerServiceJDK5"/>
</filterset>
</copy>
- <jar destfile="${build.lib}/jboss-aop.deployer" manifest="${build.etc}/default.mf"
+ <jar destfile="${build.lib}/jboss-aop-jdk50.deployer" manifest="${build.etc}/default.mf"
update="${jar.update}" index="${jar.index}">
- <fileset file="${build.lib}/jboss-aspect-library.jar"/>
- <fileset file="${jboss.aop.lib}/jboss-aop.jar"/>
+ <fileset file="${build.lib}/jboss-aspect-library-jdk50.jar"/>
+ <fileset file="${jboss.aop.lib}/jboss-aop-jdk50.jar"/>
<fileset file="${project.root}/aspects/src/etc/base-aop.xml"/>
<fileset file="${javassist.lib}/javassist.jar"/>
<fileset file="${trove.lib}/trove.jar"/>
- <fileset dir="${module.output}" >
+ <fileset dir="${module.output}">
<include name="META-INF/jboss-service.xml"/>
</fileset>
</jar>
- <delete dir="${build.meta.inf}"/>
- <!-- Generate checksums -->
- <call target="_default:compile-checksums"/>
-
+ <copy file="${project.root}/aspects/src/etc/base-aop.xml" tofile="${build.meta.inf}/base-aspects.xml"/>
+ <jar destfile="${build.lib}/jboss-aop-jboss5.deployer" manifest="${build.etc}/default.mf"
+ update="${jar.update}" index="${jar.index}">
+ <fileset file="${build.lib}/jboss-aspect-library-jdk50.jar"/>
+ <fileset file="${jboss.aop.lib}/jboss-aop-jdk50.jar"/>
+ <fileset file="${build.meta.inf}/base-aspects.xml"/>
+ <fileset file="${javassist.lib}/javassist.jar"/>
+ <fileset file="${trove.lib}/trove.jar"/>
+ <fileset dir="${source.resources}">
+ <include name="META-INF/aspect-deployer-beans.xml"/>
+ </fileset>
+ </jar>
+ <delete dir="${build.meta.inf}"/>
</target>
- <target name="jars15"
- depends="compile-classes15" if="HAVE_JDK_1.5">
-
+ <target name="jars14" depends="retrotranslate">
<mkdir dir="${build.lib}"/>
- <!-- Build jboss-aspects-jdk50.jar -->
- <jar destfile="${build.lib}/jboss-aspect-library-jdk50.jar" manifest="${build.etc}/default.mf"
+ <!-- Build jboss-aspects.jar -->
+ <jar destfile="${build.lib}/jboss-aspect-library.jar" manifest="${build.etc}/default.mf"
update="${jar.update}" index="${jar.index}">
- <fileset dir="${build.classes}">
+ <fileset dir="${build.classes.retro}">
<!-- Include everything else -->
<include name="org/jboss/**"/>
- <exclude name="org.jboss.aop.microcontainer.prototype.AnnotationDependencyLister.class"/>
- <exclude name="org/jboss/aspects/asynchronous/aspects/jboss/Asynchronous.class"/>
- <exclude name="org/jboss/aspects/asynch/Asynchronous.class"/>
- <exclude name="org/jboss/aspects/asynch/AsynchExecutor.class"/>
- <exclude name="org/jboss/aspects/asynch/ThreadPoolExecutor*.class"/>
- <exclude name="org/jboss/aspects/asynch/FutureImpl.class"/>
- <exclude name="org/jboss/aspects/Current.class"/>
- <exclude name="org/jboss/aspects/jmx/MBean.class"/>
- <exclude name="org/jboss/test/**"/>
- <exclude name="org/jboss/aspects/Injected.class"/>
- <exclude name="org/jboss/aspects/dbc/Dbc.class"/>
- <exclude name="org/jboss/aspects/dbc/Invariant.class"/>
- <exclude name="org/jboss/aspects/dbc/PostCond.class"/>
- <exclude name="org/jboss/aspects/dbc/PreCond.class"/>
- <exclude name="org/jboss/aspects/dbc/StaticInvariant.class"/>
- <exclude name="org/jboss/aspects/tx/TxType.class"/>
- <exclude name="org/jboss/aspects/tx/Tx.class"/>
- <exclude name="org/jboss/aspects/tx/TxLocal.class"/>
- <exclude name="org/jboss/aspects/txlock/TxSynchronized.class"/>
- <exclude name="org/jboss/aspects/security/SecurityDomain.class"/>
- <exclude name="org/jboss/aspects/security/Exclude.class"/>
- <exclude name="org/jboss/aspects/security/Unchecked.class"/>
- <exclude name="org/jboss/aspects/security/RunAs.class"/>
- <exclude name="org/jboss/aspects/security/Permissions.class"/>
- <exclude name="org/jboss/aspects/patterns/readwritelock/readLockOperation.class"/>
- <exclude name="org/jboss/aspects/patterns/readwritelock/writeLockOperation.class"/>
</fileset>
- <fileset dir="${build15.classes}">
- <include name="org/jboss/**"/>
- </fileset>
<fileset dir="${build.etc}">
<include name="org/jboss/**/*.xml"/>
</fileset>
- </jar>
-
- <!-- Build client jar containing the minimum needed for ejb 3 -->
- <jar destfile="${build.lib}/jboss-aspect-jdk50-client.jar" manifest="${build.etc}/default.mf"
- update="${jar.update}" index="${jar.index}">
- <fileset dir="${build.classes}">
- <!-- Include everything else -->
- <include name="org/jboss/aspects/asynch/AsynchProvider.class"/>
- <include name="org/jboss/aspects/asynch/AsynchProxyInterceptor.class"/>
- <include name="org/jboss/aspects/asynch/AsynchMixin.class"/>
- <include name="org/jboss/aspects/asynch/Future.class"/>
- <include name="org/jboss/aspects/asynch/FutureHolder.class"/>
- <include name="org/jboss/aspects/asynch/FutureInvocationHandler.class"/>
- <include name="org/jboss/aspects/asynch/RemotableFuture.class"/>
- <include name="org/jboss/aspects/asynch/TimeoutException.class"/>
- <include name="org/jboss/aspects/remoting/ClusterConstants.class"/>
- <include name="org/jboss/aspects/remoting/ClusterChooserInterceptor.class"/>
- <include name="org/jboss/aspects/remoting/FamilyWrapper.class"/>
- <include name="org/jboss/aspects/remoting/InvokeRemoteInterceptor.class"/>
- <include name="org/jboss/aspects/remoting/IsLocalInterceptor.class"/>
- <include name="org/jboss/aspects/remoting/MergeMetaDataInterceptor.class"/>
- <include name="org/jboss/aspects/remoting/PojiProxy.class"/>
- <include name="org/jboss/aspects/tx/ClientTxPropagationInterceptor.class"/>
- <include name="org/jboss/aspects/security/SecurityClientInterceptor.class"/>
- <include name="org/jboss/aspects/security/SecurityActions*.class"/>
+ <fileset dir="${build.resources}">
+ <include name="aop-deployer_1_1.xsd"/>
</fileset>
- <fileset dir="${build15.classes}">
- <include name="org/jboss/aspects/asynch/AsynchExecutor.class"/>
- <include name="org/jboss/aspects/asynch/FutureImpl.class"/>
- <include name="org/jboss/aspects/asynch/ThreadPoolExecutor*.class"/>
- </fileset>
</jar>
- <jar destfile="${build.lib}/jboss-aspect-library-jdk50-jb32.jar" manifest="${build.etc}/default.mf"
+ <jar destfile="${build.lib}/jboss-aspect-library32.jar" manifest="${build.etc}/default.mf"
update="${jar.update}" index="${jar.index}">
- <fileset dir="${build.classes}">
+ <fileset dir="${build.classes.retro}">
<!-- Include everything else -->
<include name="org/jboss/**"/>
- <exclude name="org/jboss/aspects/asynchronous/aspects/jboss/Asynchronous.class"/>
- <exclude name="org/jboss/aspects/asynch/Asynchronous.class"/>
- <exclude name="org/jboss/aspects/asynch/AsynchExecutor.class"/>
- <exclude name="org/jboss/aspects/asynch/ThreadPoolExecutor*.class"/>
- <exclude name="org/jboss/aspects/asynch/FutureImpl.class"/>
- <exclude name="org/jboss/aspects/Current.class"/>
- <exclude name="org/jboss/aspects/jmx/MBean.class"/>
- <exclude name="org/jboss/test/**"/>
- <exclude name="org/jboss/aspects/Injected.class"/>
- <exclude name="org/jboss/aspects/dbc/Dbc.class"/>
- <exclude name="org/jboss/aspects/dbc/Invariant.class"/>
- <exclude name="org/jboss/aspects/dbc/PostCond.class"/>
- <exclude name="org/jboss/aspects/dbc/PreCond.class"/>
- <exclude name="org/jboss/aspects/dbc/StaticInvariant.class"/>
- <exclude name="org/jboss/aspects/tx/TxType.class"/>
- <exclude name="org/jboss/aspects/tx/Tx.class"/>
- <exclude name="org/jboss/aspects/tx/TxLocal.class"/>
- <exclude name="org/jboss/aspects/txlock/TxSynchronized.class"/>
- <exclude name="org/jboss/aspects/security/SecurityDomain.class"/>
- <exclude name="org/jboss/aspects/security/Exclude.class"/>
- <exclude name="org/jboss/aspects/security/Unchecked.class"/>
- <exclude name="org/jboss/aspects/security/RunAs.class"/>
- <exclude name="org/jboss/aspects/security/Permissions.class"/>
</fileset>
- <fileset dir="${build15.classes}">
- <include name="org/jboss/**"/>
- </fileset>
<fileset dir="${build.etc}">
<include name="org/jboss/**/*.xml"/>
</fileset>
@@ -419,24 +367,27 @@
</jar>
<mkdir dir="${build.meta.inf}"/>
- <!--copy file="${source.resources}/META-INF/jboss-service.xml" todir="${build.meta.inf}" filtering="true">
+ <copy file="${source.resources}/META-INF/jboss-service.xml" todir="${build.meta.inf}" filtering="true">
<filterset>
- <filter token="SERVICE_NAME" value="org.jboss.aop.deployment.AspectManagerServiceJDK5"/>
+ <filter token="SERVICE_NAME" value="org.jboss.aop.deployment.AspectManagerService"/>
</filterset>
- </copy-->
- <copy file="${source.resources}/META-INF/aspect-deployers-beans.xml" todir="${build.meta.inf}"/>
- <jar destfile="${build.lib}/jboss-aop-jdk50.deployer" manifest="${build.etc}/default.mf"
+ </copy>
+ <jar destfile="${build.lib}/jboss-aop.deployer" manifest="${build.etc}/default.mf"
update="${jar.update}" index="${jar.index}">
- <fileset file="${build.lib}/jboss-aspect-library-jdk50.jar"/>
- <fileset file="${jboss.aop.lib}/jboss-aop-jdk50.jar"/>
+ <fileset file="${build.lib}/jboss-aspect-library.jar"/>
+ <fileset file="${jboss.aop.lib}/jboss-aop.jar"/>
<fileset file="${project.root}/aspects/src/etc/base-aop.xml"/>
<fileset file="${javassist.lib}/javassist.jar"/>
<fileset file="${trove.lib}/trove.jar"/>
- <fileset dir="${module.output}">
- <include name="META-INF/aspect-deployers-beans.xml"/>
+ <fileset dir="${module.output}" >
+ <include name="META-INF/jboss-service.xml"/>
</fileset>
</jar>
<delete dir="${build.meta.inf}"/>
+
+ <!-- Generate checksums -->
+ <call target="_default:compile-checksums"/>
+
</target>
@@ -627,11 +578,11 @@
<target name="all"
description="Builds everything."
- depends="output, jars15, docs"/>
+ depends="output, jars14, docs"/>
<target name="most"
description="Builds almost everything."
- depends="output, jars15"/>
+ depends="output, jars14"/>
<target name="help"
description="Show this help message."
Added: trunk/aspects/src/main/org/jboss/aop/deployment/AspectManagerService32JDK5.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aop/deployment/AspectManagerService32JDK5.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aop/deployment/AspectManagerService32JDK5.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.aop.deployment;
+
+import javassist.scopedpool.ScopedClassPoolFactory;
+
+import org.jboss.aop.ClassLoaderValidation;
+
+/**
+ * comment
+ *
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ */
+public class AspectManagerService32JDK5 extends AspectManagerServiceJDK5
+{
+ protected ScopedClassPoolFactory createFactory() throws Exception
+ {
+ return new JBossClassPoolFactory32(tmpClassesDir);
+ }
+
+ protected ClassLoaderValidation createClassLoaderValidation()
+ {
+ return new JBossClassLoaderValidator32();
+ }
+
+ protected void baseAop()
+ {
+ // complete
+ }
+}
Added: trunk/aspects/src/main/org/jboss/aop/deployment/AspectManagerServiceJDK5.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aop/deployment/AspectManagerServiceJDK5.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aop/deployment/AspectManagerServiceJDK5.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.aop.deployment;
+
+import org.jboss.aop.standalone.AOPTransformer;
+import org.jboss.aop.standalone.PluggableInstrumentor;
+
+/**
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ * @version $Revision: 57692 $
+ * @jmx:mbean extends="org.jboss.system.ServiceMBean"
+ */
+public class AspectManagerServiceJDK5 extends AspectManagerService
+{
+ public AspectManagerServiceJDK5()
+ {
+ }
+
+ public AspectManagerServiceJDK5(String baseXml)
+ {
+ super(baseXml);
+ }
+
+ protected AOPTransformer transformer = new AOPTransformer();
+
+ protected void attachTranslator()
+ {
+ PluggableInstrumentor.getInstrumentor().addTransformer(transformer);
+ }
+
+ protected void detachTranslator()
+ {
+ PluggableInstrumentor.getInstrumentor().removeTransformer(transformer);
+ }
+
+}
Modified: trunk/aspects/src/main/org/jboss/aspects/Current.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/Current.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/Current.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -21,6 +21,11 @@
*/
package org.jboss.aspects;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
/**
* This is an annotation.
*
@@ -30,6 +35,7 @@
* @author <a href="mailto:bill at jboss.org">Bill Burke</a>
* @version $Revision$
*/
-public interface Current
+ at Target({ElementType.FIELD}) @Retention(RetentionPolicy.RUNTIME)
+public @interface Current
{
}
Modified: trunk/aspects/src/main/org/jboss/aspects/Injected.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/Injected.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/Injected.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -21,6 +21,11 @@
*/
package org.jboss.aspects;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
/**
* This is an annotation
*
@@ -32,6 +37,7 @@
* @author <a href="mailto:bill at jboss.org">Bill Burke</a>
* @version $Revision$
*/
-public interface Injected
+ at Target({ElementType.METHOD, ElementType.FIELD}) @Retention(RetentionPolicy.RUNTIME)
+public @interface Injected
{
}
Modified: trunk/aspects/src/main/org/jboss/aspects/asynch/AsynchExecutor.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/asynch/AsynchExecutor.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/asynch/AsynchExecutor.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -21,13 +21,17 @@
*/
package org.jboss.aspects.asynch;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
/**
- * JDK 1.4 annotation that
+ * Allow user to plug in executor that will run asynch tasks
*
* @author <a href="mailto:bill at jboss.org">Bill Burke</a>
* @version $Revision$
*/
-public interface AsynchExecutor
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface AsynchExecutor
{
Class value();
}
Modified: trunk/aspects/src/main/org/jboss/aspects/asynch/Asynchronous.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/asynch/Asynchronous.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/asynch/Asynchronous.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -21,12 +21,19 @@
*/
package org.jboss.aspects.asynch;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
/**
* Comment
*
* @author <a href="mailto:bill at jboss.org">Bill Burke</a>
* @version $Revision$
*/
-public interface Asynchronous
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target(ElementType.METHOD)
+public @interface Asynchronous
{
}
Added: trunk/aspects/src/main/org/jboss/aspects/asynch/FutureImplJavaUtilConcurrent.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/asynch/FutureImplJavaUtilConcurrent.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/asynch/FutureImplJavaUtilConcurrent.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -0,0 +1,100 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.aspects.asynch;
+
+
+import org.jboss.aop.Dispatcher;
+import org.jboss.util.id.GUID;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ * @version $Revision: 37406 $
+ */
+public class FutureImplJavaUtilConcurrent implements RemotableFuture
+{
+ private java.util.concurrent.Future result;
+ private GUID remoteObjectID;
+
+ public FutureImplJavaUtilConcurrent(java.util.concurrent.Future result)
+ {
+ this.result = result;
+ }
+
+ public void setRemoteObjectID(GUID remoteObjectID)
+ {
+ this.remoteObjectID = remoteObjectID;
+ }
+
+ public void release()
+ {
+ if (remoteObjectID != null)
+ {
+ Dispatcher.singleton.unregisterTarget(remoteObjectID);
+ }
+ }
+
+ public Object get() throws InterruptedException, InvocationTargetException
+ {
+ try
+ {
+ Object rtn = result.get();
+ release();
+ return rtn;
+ }
+ catch (ExecutionException e)
+ {
+ release();
+ throw new InvocationTargetException(e.getCause());
+ }
+ }
+
+ public Object get(long milliseconds) throws org.jboss.aspects.asynch.TimeoutException, InterruptedException, InvocationTargetException
+ {
+ try
+ {
+ Object rtn = result.get(milliseconds, TimeUnit.MILLISECONDS);
+ release();
+ return rtn;
+ }
+ catch (ExecutionException e)
+ {
+ release();
+ throw new InvocationTargetException(e.getCause());
+ }
+ catch (java.util.concurrent.TimeoutException e)
+ {
+ throw new org.jboss.aspects.asynch.TimeoutException(e);
+ }
+ }
+
+ public boolean isDone()
+ {
+ return result.isDone();
+ }
+
+}
Modified: trunk/aspects/src/main/org/jboss/aspects/asynch/ThreadPoolExecutor.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/asynch/ThreadPoolExecutor.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/asynch/ThreadPoolExecutor.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -21,22 +21,22 @@
*/
package org.jboss.aspects.asynch;
-import EDU.oswego.cs.dl.util.concurrent.Callable;
-import EDU.oswego.cs.dl.util.concurrent.Executor;
-import EDU.oswego.cs.dl.util.concurrent.FutureResult;
-import EDU.oswego.cs.dl.util.concurrent.PooledExecutor;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
import org.jboss.aop.Advisor;
import org.jboss.aop.joinpoint.MethodInvocation;
/**
- * Use a global thread pool to execute asynch tasks
+ * Comment
*
* @author <a href="mailto:bill at jboss.org">Bill Burke</a>
* @version $Revision$
*/
public class ThreadPoolExecutor implements ExecutorAbstraction
{
- private static Executor executor = new PooledExecutor();
+ private static ExecutorService executor = Executors.newCachedThreadPool();
public void setAdvisor(Advisor advisor)
{
@@ -48,8 +48,7 @@
final MethodInvocation copy = (MethodInvocation) invocation.copy();
final ClassLoader cl = Thread.currentThread().getContextClassLoader();
- FutureResult result = new FutureResult();
- Runnable command = result.setter(new Callable()
+ java.util.concurrent.Future future = executor.submit(new Callable()
{
public Object call() throws Exception
{
@@ -69,9 +68,8 @@
}
}
});
- executor.execute(command);
- return new FutureImpl(result);
+ return new FutureImplJavaUtilConcurrent(future);
}
}
Modified: trunk/aspects/src/main/org/jboss/aspects/asynchronous/aspects/jboss/Asynchronous.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/asynchronous/aspects/jboss/Asynchronous.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/asynchronous/aspects/jboss/Asynchronous.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -22,14 +22,16 @@
package org.jboss.aspects.asynchronous.aspects.jboss;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
/**
- * @author <a href="mailto:chussenet at yahoo.com">{Claude Hussenet Independent Consultant}</a>.
* @version <tt>$Revision$</tt>
+ * @author <a href="mailto:chussenet at yahoo.com">{Claude Hussenet Independent Consultant}</a>.
*/
-
-public interface Asynchronous
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface Asynchronous
{
- public String id();
-
- public long timeout();
+ String id();
+ long timeout() default 0;
}
Added: trunk/aspects/src/main/org/jboss/aspects/concurrent/LatchAspect.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/concurrent/LatchAspect.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/concurrent/LatchAspect.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.aspects.concurrent;
+
+import org.jboss.aop.joinpoint.Invocation;
+
+import java.util.concurrent.CountDownLatch;
+
+/**
+ * comment
+ *
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ */
+public class LatchAspect
+{
+ public Object checkLatch(Invocation invocation) throws Throwable
+ {
+ LatchedObject latched = (LatchedObject) invocation.getTargetObject();
+ CountDownLatch latch = latched.getLatch();
+ try
+ {
+ latch.await();
+ }
+ catch (InterruptedException e)
+ {
+ throw new RuntimeException(e);
+ }
+ return invocation.invokeNext();
+ }
+}
Added: trunk/aspects/src/main/org/jboss/aspects/concurrent/Latched.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/concurrent/Latched.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/concurrent/Latched.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.aspects.concurrent;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.annotation.Inherited;
+
+
+/**
+ * comment
+ *
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ */
+ at Target({ElementType.TYPE})
+ at Retention(RetentionPolicy.RUNTIME)
+ at Inherited
+public @interface Latched
+{
+ int countdown() default 1;
+}
Added: trunk/aspects/src/main/org/jboss/aspects/concurrent/LatchedObject.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/concurrent/LatchedObject.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/concurrent/LatchedObject.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.aspects.concurrent;
+
+import java.util.concurrent.CountDownLatch;
+
+/**
+ * comment
+ *
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ */
+public interface LatchedObject
+{
+ CountDownLatch getLatch();
+ void resetLatch(int count);
+}
Added: trunk/aspects/src/main/org/jboss/aspects/concurrent/LatchedObjectMixin.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/concurrent/LatchedObjectMixin.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/concurrent/LatchedObjectMixin.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.aspects.concurrent;
+
+import java.util.concurrent.CountDownLatch;
+
+/**
+ * comment
+ *
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ */
+public class LatchedObjectMixin implements LatchedObject
+{
+ private CountDownLatch latch;
+
+ public LatchedObjectMixin(Object obj)
+ {
+ Latched l = obj.getClass().getAnnotation(Latched.class);
+ latch = new CountDownLatch(l.countdown());
+ }
+ public CountDownLatch getLatch()
+ {
+ return latch;
+ }
+
+ public void resetLatch(int count)
+ {
+ latch = new CountDownLatch(count);
+ }
+}
Added: trunk/aspects/src/main/org/jboss/aspects/concurrent/LockAcquisitionFailureException.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/concurrent/LockAcquisitionFailureException.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/concurrent/LockAcquisitionFailureException.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.aspects.concurrent;
+
+/**
+ * comment
+ *
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ */
+public class LockAcquisitionFailureException extends RuntimeException
+{
+ private static final long serialVersionUID = -9086581326875051914L;
+
+ public LockAcquisitionFailureException()
+ {
+ }
+
+ public LockAcquisitionFailureException(String message)
+ {
+ super(message);
+ }
+
+ public LockAcquisitionFailureException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public LockAcquisitionFailureException(Throwable cause)
+ {
+ super(cause);
+ }
+}
Added: trunk/aspects/src/main/org/jboss/aspects/concurrent/MutexAspect.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/concurrent/MutexAspect.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/concurrent/MutexAspect.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -0,0 +1,127 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.aspects.concurrent;
+
+import org.jboss.aop.joinpoint.Invocation;
+
+import java.util.concurrent.locks.ReentrantLock;
+
+/**
+ * comment
+ *
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ */
+public class MutexAspect
+{
+ public static class BlockingMutex
+ {
+ protected MutexLocked props;
+
+ public Object acquire(Invocation invocation) throws Throwable
+ {
+ MutexedObject obj = (MutexedObject) invocation.getTargetObject();
+ ReentrantLock lock = obj.getMutex();
+ try
+ {
+ lock.lockInterruptibly();
+ }
+ catch (InterruptedException e)
+ {
+ throw new LockAcquisitionFailureException("Failed to lock for @Mutexed class", e);
+ }
+
+
+ try
+ {
+ return invocation.invokeNext();
+ }
+ finally
+ {
+ lock.unlock();
+ }
+ }
+ }
+
+ public static class TryLockMutex
+ {
+ protected MutexLocked props;
+
+ public Object acquire(Invocation invocation) throws Throwable
+ {
+ MutexedObject obj = (MutexedObject) invocation.getTargetObject();
+ ReentrantLock lock = obj.getMutex();
+ if (!lock.tryLock())
+ {
+ throw new LockAcquisitionFailureException("Failed to lock for @Mutexed class");
+ }
+
+ try
+ {
+ return invocation.invokeNext();
+ }
+ finally
+ {
+ lock.unlock();
+ }
+ }
+ }
+
+
+ public static class TimeoutMutex
+ {
+ protected MutexLocked props;
+
+ public TimeoutMutex(MutexLocked props)
+ {
+ this.props = props;
+ }
+
+ public Object acquire(Invocation invocation) throws Throwable
+ {
+ MutexedObject obj = (MutexedObject) invocation.getTargetObject();
+ ReentrantLock lock = obj.getMutex();
+ try
+ {
+ if (!lock.tryLock(props.timeout(), props.unit()))
+ {
+ throw new LockAcquisitionFailureException("Failed to acquire permit for @Semaphored class. Timeout reached.");
+ }
+ }
+ catch (InterruptedException e)
+ {
+ throw new LockAcquisitionFailureException("Failed to acquire permit for @Semaphored class", e);
+ }
+
+
+ try
+ {
+ return invocation.invokeNext();
+ }
+ finally
+ {
+ lock.unlock();
+ }
+ }
+ }
+
+
+}
Added: trunk/aspects/src/main/org/jboss/aspects/concurrent/MutexAspectFactory.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/concurrent/MutexAspectFactory.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/concurrent/MutexAspectFactory.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -0,0 +1,79 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.aspects.concurrent;
+
+import org.jboss.aop.advice.AspectFactory;
+import org.jboss.aop.Advisor;
+import org.jboss.aop.InstanceAdvisor;
+import org.jboss.aop.joinpoint.Joinpoint;
+import org.jboss.aop.joinpoint.MethodJoinpoint;
+
+/**
+ * comment
+ *
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ */
+public class MutexAspectFactory implements AspectFactory
+{
+ public Object createPerVM()
+ {
+ throw new IllegalStateException("THIS SCOPE NOT USABLE");
+ }
+
+ public Object createPerClass(Advisor advisor)
+ {
+ throw new IllegalStateException("THIS SCOPE NOT USABLE");
+ }
+
+ public Object createPerInstance(Advisor advisor, InstanceAdvisor instanceAdvisor)
+ {
+ throw new IllegalStateException("THIS SCOPE NOT USABLE");
+ }
+
+ public Object createPerJoinpoint(Advisor advisor, Joinpoint jp)
+ {
+ MethodJoinpoint mj = (MethodJoinpoint)jp;
+ MutexLocked props = (MutexLocked)advisor.resolveAnnotation(mj.getMethod(), MutexLocked.class);
+ if (props.timeout() < 0)
+ {
+ return new MutexAspect.BlockingMutex();
+ }
+ else if (props.timeout() == 0)
+ {
+ return new MutexAspect.TryLockMutex();
+ }
+ else
+ {
+ return new MutexAspect.TimeoutMutex(props);
+ }
+ }
+
+ public Object createPerJoinpoint(Advisor advisor, InstanceAdvisor instanceAdvisor, Joinpoint jp)
+ {
+ throw new IllegalStateException("THIS SCOPE NOT USABLE");
+ }
+
+ public String getName()
+ {
+ return MutexAspectFactory.class.getName();
+ }
+}
Added: trunk/aspects/src/main/org/jboss/aspects/concurrent/MutexLocked.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/concurrent/MutexLocked.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/concurrent/MutexLocked.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.aspects.concurrent;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.util.concurrent.TimeUnit;
+
+
+/**
+ * comment
+ *
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ */
+ at Target({ElementType.METHOD, ElementType.TYPE, ElementType.FIELD, ElementType.PARAMETER})
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface MutexLocked
+{
+ /**
+ * Defaults to -1, block until acquired
+ * 0 is just a tryLock
+ *
+ */
+ long timeout() default -1;
+ TimeUnit unit() default TimeUnit.MILLISECONDS;
+}
Added: trunk/aspects/src/main/org/jboss/aspects/concurrent/Mutexed.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/concurrent/Mutexed.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/concurrent/Mutexed.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.aspects.concurrent;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+
+/**
+ * comment
+ *
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ */
+ at Target({ElementType.TYPE})
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface Mutexed
+{
+ boolean isFair() default false;
+}
Added: trunk/aspects/src/main/org/jboss/aspects/concurrent/MutexedMethod.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/concurrent/MutexedMethod.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/concurrent/MutexedMethod.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.aspects.concurrent;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.util.concurrent.TimeUnit;
+
+
+/**
+ * Attach a semaphore to a method.
+ * Only a certain amount of threads are allowed to access that method at one time.
+ *
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ */
+ at Target({ElementType.METHOD})
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface MutexedMethod
+{
+ boolean isFair() default false;
+
+ long timeout() default -1;
+ TimeUnit unit() default TimeUnit.MILLISECONDS;
+}
Added: trunk/aspects/src/main/org/jboss/aspects/concurrent/MutexedMethodAspect.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/concurrent/MutexedMethodAspect.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/concurrent/MutexedMethodAspect.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -0,0 +1,103 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.aspects.concurrent;
+
+import org.jboss.aop.joinpoint.Invocation;
+
+import java.util.concurrent.locks.ReentrantLock;
+
+/**
+ * comment
+ *
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ */
+public class MutexedMethodAspect
+{
+ protected ReentrantLock lock;
+ protected MutexedMethod props;
+
+ public MutexedMethodAspect(MutexedMethod m)
+ {
+ props = m;
+ lock = new ReentrantLock(m.isFair());
+ }
+
+ public Object acquire(Invocation invocation) throws Throwable
+ {
+ if (props.timeout() == -1)
+ {
+ blockIndefinately();
+ }
+ else if (props.timeout() == 0)
+ {
+ tryLock();
+ }
+ else
+ {
+ tryLockWithTimeout();
+ }
+
+ try
+ {
+ return invocation.invokeNext();
+ }
+ finally
+ {
+ lock.unlock();
+ }
+ }
+
+ protected void blockIndefinately()
+ {
+ try
+ {
+ lock.lockInterruptibly();
+ }
+ catch (InterruptedException e)
+ {
+ throw new LockAcquisitionFailureException("Failed to lock @MutexedMethod", e);
+ }
+ }
+
+ protected void tryLock()
+ {
+ if (!lock.tryLock())
+ {
+ throw new LockAcquisitionFailureException("Failed to lock @MutexedMethod");
+ }
+ }
+
+ protected void tryLockWithTimeout()
+ {
+ try
+ {
+ if (!lock.tryLock(props.timeout(), props.unit()))
+ {
+ throw new LockAcquisitionFailureException("Failed to lock @MutexedMethod. Timeout reached.");
+ }
+ }
+ catch (InterruptedException e)
+ {
+ throw new LockAcquisitionFailureException("Failed to lock @MutexedMethod", e);
+ }
+ }
+}
Added: trunk/aspects/src/main/org/jboss/aspects/concurrent/MutexedObject.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/concurrent/MutexedObject.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/concurrent/MutexedObject.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.aspects.concurrent;
+
+import java.util.concurrent.locks.ReentrantLock;
+
+/**
+ * comment
+ *
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ */
+public interface MutexedObject
+{
+ public ReentrantLock getMutex();
+}
Added: trunk/aspects/src/main/org/jboss/aspects/concurrent/MutexedObjectMixin.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/concurrent/MutexedObjectMixin.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/concurrent/MutexedObjectMixin.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.aspects.concurrent;
+
+import java.util.concurrent.locks.ReentrantLock;
+
+/**
+ * comment
+ *
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ */
+public class MutexedObjectMixin implements MutexedObject
+{
+ protected ReentrantLock lock;
+
+ public MutexedObjectMixin(Object obj)
+ {
+ Mutexed m = obj.getClass().getAnnotation(Mutexed.class);
+ lock = new ReentrantLock(m.isFair());
+ }
+
+ public ReentrantLock getMutex()
+ {
+ return lock;
+ }
+}
Added: trunk/aspects/src/main/org/jboss/aspects/concurrent/SemaphoreAspect.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/concurrent/SemaphoreAspect.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/concurrent/SemaphoreAspect.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -0,0 +1,103 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.aspects.concurrent;
+
+import org.jboss.aop.joinpoint.Invocation;
+
+import java.util.concurrent.Semaphore;
+
+/**
+ * comment
+ *
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ */
+public class SemaphoreAspect
+{
+ protected SemaphoreLocked props;
+
+ public SemaphoreAspect(SemaphoreLocked locked)
+ {
+ this.props = locked;
+ }
+
+ public Object acquire(Invocation invocation) throws Throwable
+ {
+ SemaphoredObject obj = (SemaphoredObject)invocation.getTargetObject();
+
+ if (props.timeout() == -1)
+ {
+ blockIndefinately(obj.getSemaphore());
+ }
+ else if (props.timeout() == 0)
+ {
+ tryLock(obj.getSemaphore());
+ }
+ else
+ {
+ tryLockWithTimeout(obj.getSemaphore());
+ }
+
+ try
+ {
+ return invocation.invokeNext();
+ }
+ finally
+ {
+ obj.getSemaphore().release(props.permits());
+ }
+ }
+
+ protected void blockIndefinately(Semaphore semaphore)
+ {
+ try
+ {
+ semaphore.acquire(props.permits());
+ }
+ catch (InterruptedException e)
+ {
+ throw new LockAcquisitionFailureException("Failed to acquire permit for @Semaphored class", e);
+ }
+ }
+
+ protected void tryLock(Semaphore semaphore)
+ {
+ if (!semaphore.tryAcquire(props.permits()))
+ {
+ throw new LockAcquisitionFailureException("Failed to acquire permit for @Semaphored class");
+ }
+ }
+
+ protected void tryLockWithTimeout(Semaphore semaphore)
+ {
+ try
+ {
+ if (!semaphore.tryAcquire(props.timeout(), props.unit()))
+ {
+ throw new LockAcquisitionFailureException("Failed to acquire permit for @Semaphored class. Timeout reached.");
+ }
+ }
+ catch (InterruptedException e)
+ {
+ throw new LockAcquisitionFailureException("Failed to acquire permit for @Semaphored class", e);
+ }
+ }
+}
Added: trunk/aspects/src/main/org/jboss/aspects/concurrent/SemaphoreLocked.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/concurrent/SemaphoreLocked.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/concurrent/SemaphoreLocked.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.aspects.concurrent;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.util.concurrent.TimeUnit;
+
+
+/**
+ * Only a certain amount of threads can access a @Semaphored object.
+ * Acquire a permit when entering a method, release it when leaving.
+ *
+ * @see Semaphored
+ *
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ */
+ at Target({ElementType.METHOD})
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface SemaphoreLocked
+{
+ /**
+ * Num permits to acquire
+ */
+ int permits() default 1;
+ /**
+ * Defaults to -1, block until acquired
+ * 0 is just a tryLock
+ *
+ */
+ long timeout() default -1;
+ TimeUnit unit() default TimeUnit.MILLISECONDS;
+}
Added: trunk/aspects/src/main/org/jboss/aspects/concurrent/Semaphored.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/concurrent/Semaphored.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/concurrent/Semaphored.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.aspects.concurrent;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.annotation.Inherited;
+
+
+/**
+ * comment
+ *
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ */
+ at Target({ElementType.METHOD})
+ at Retention(RetentionPolicy.RUNTIME)
+ at Inherited
+public @interface Semaphored
+{
+ int permits();
+ boolean isFair() default false;
+}
Added: trunk/aspects/src/main/org/jboss/aspects/concurrent/SemaphoredMethod.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/concurrent/SemaphoredMethod.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/concurrent/SemaphoredMethod.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.aspects.concurrent;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.util.concurrent.TimeUnit;
+
+
+/**
+ * Attach a semaphore to a method.
+ * Only a certain amount of threads are allowed to access that method at one time.
+ *
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ */
+ at Target({ElementType.METHOD})
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface SemaphoredMethod
+{
+ /**
+ * max number of permits
+ */
+ int permits();
+ boolean isFair() default false;
+
+ long timeout() default -1;
+ TimeUnit unit() default TimeUnit.MILLISECONDS;
+}
Added: trunk/aspects/src/main/org/jboss/aspects/concurrent/SemaphoredMethodAspect.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/concurrent/SemaphoredMethodAspect.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/concurrent/SemaphoredMethodAspect.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -0,0 +1,103 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.aspects.concurrent;
+
+import org.jboss.aop.joinpoint.Invocation;
+
+import java.util.concurrent.Semaphore;
+
+/**
+ * comment
+ *
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ */
+public class SemaphoredMethodAspect
+{
+ protected Semaphore semaphore;
+ protected SemaphoredMethod props;
+
+ public SemaphoredMethodAspect(SemaphoredMethod m)
+ {
+ props = m;
+ semaphore = new Semaphore(m.permits(), m.isFair());
+ }
+
+ public Object acquire(Invocation invocation) throws Throwable
+ {
+ if (props.timeout() == -1)
+ {
+ blockIndefinately();
+ }
+ else if (props.timeout() == 0)
+ {
+ tryLock();
+ }
+ else
+ {
+ tryLockWithTimeout();
+ }
+
+ try
+ {
+ return invocation.invokeNext();
+ }
+ finally
+ {
+ semaphore.release();
+ }
+ }
+
+ protected void blockIndefinately()
+ {
+ try
+ {
+ semaphore.acquire();
+ }
+ catch (InterruptedException e)
+ {
+ throw new LockAcquisitionFailureException("Failed to acquire permit for @SemaphoredMethod", e);
+ }
+ }
+
+ protected void tryLock()
+ {
+ if (!semaphore.tryAcquire())
+ {
+ throw new LockAcquisitionFailureException("Failed to acquire permit for @SemaphoredMethod");
+ }
+ }
+
+ protected void tryLockWithTimeout()
+ {
+ try
+ {
+ if (!semaphore.tryAcquire(props.permits(), props.timeout(), props.unit()))
+ {
+ throw new LockAcquisitionFailureException("Failed to acquire permit for @SemaphoredMethod. Timeout reached.");
+ }
+ }
+ catch (InterruptedException e)
+ {
+ throw new LockAcquisitionFailureException("Failed to acquire permit for @Semaphored class", e);
+ }
+ }
+}
Added: trunk/aspects/src/main/org/jboss/aspects/concurrent/SemaphoredObject.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/concurrent/SemaphoredObject.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/concurrent/SemaphoredObject.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.aspects.concurrent;
+
+import java.util.concurrent.Semaphore;
+
+/**
+ * comment
+ *
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ */
+public interface SemaphoredObject
+{
+ Semaphore getSemaphore();
+}
Added: trunk/aspects/src/main/org/jboss/aspects/concurrent/SemaphoredObjectMixin.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/concurrent/SemaphoredObjectMixin.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/concurrent/SemaphoredObjectMixin.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.aspects.concurrent;
+
+import java.util.concurrent.Semaphore;
+
+/**
+ * comment
+ *
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ */
+public class SemaphoredObjectMixin implements SemaphoredObject
+{
+ private Semaphore semaphore;
+
+ public SemaphoredObjectMixin(Object obj)
+ {
+ Semaphored l = obj.getClass().getAnnotation(Semaphored.class);
+ semaphore = new Semaphore(l.permits(), l.isFair());
+ }
+
+ public Semaphore getSemaphore()
+ {
+ return semaphore;
+ }
+}
Modified: trunk/aspects/src/main/org/jboss/aspects/dbc/Dbc.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/dbc/Dbc.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/dbc/Dbc.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -21,12 +21,17 @@
*/
package org.jboss.aspects.dbc;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
/**
*
* @author <a href="mailto:kabir.khan at jboss.org">Kabir Khan</a>
* @version $Revision$
*/
-public interface Dbc
+ at Target({ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME)
+public @interface Dbc
{
-
}
Modified: trunk/aspects/src/main/org/jboss/aspects/dbc/Invariant.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/dbc/Invariant.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/dbc/Invariant.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -21,12 +21,18 @@
*/
package org.jboss.aspects.dbc;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
/**
*
* @author <a href="mailto:kabir.khan at jboss.org">Kabir Khan</a>
* @version $Revision$
*/
-public interface Invariant
+ at Target({ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME)
+public @interface Invariant
{
String[] value();
}
Modified: trunk/aspects/src/main/org/jboss/aspects/dbc/PostCond.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/dbc/PostCond.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/dbc/PostCond.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -21,12 +21,17 @@
*/
package org.jboss.aspects.dbc;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
/**
*
* @author <a href="mailto:kabir.khan at jboss.org">Kabir Khan</a>
* @version $Revision$
*/
-public interface PostCond
+ at Target({ElementType.METHOD, ElementType.CONSTRUCTOR}) @Retention(RetentionPolicy.RUNTIME)
+public @interface PostCond
{
String[] value();
}
Modified: trunk/aspects/src/main/org/jboss/aspects/dbc/PreCond.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/dbc/PreCond.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/dbc/PreCond.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -21,12 +21,19 @@
*/
package org.jboss.aspects.dbc;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
/**
*
* @author <a href="mailto:kabir.khan at jboss.org">Kabir Khan</a>
* @version $Revision$
*/
-public interface PreCond
+ at Target({ElementType.METHOD, ElementType.CONSTRUCTOR}) @Retention(RetentionPolicy.RUNTIME)
+public @interface PreCond
{
String[] value();
}
+
Modified: trunk/aspects/src/main/org/jboss/aspects/dbc/StaticInvariant.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/dbc/StaticInvariant.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/dbc/StaticInvariant.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -21,12 +21,17 @@
*/
package org.jboss.aspects.dbc;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
/**
*
* @author <a href="mailto:kabir.khan at jboss.org">Kabir Khan</a>
* @version $Revision$
*/
-public interface StaticInvariant
+ at Target({ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME)
+public @interface StaticInvariant
{
String[] value();
}
Modified: trunk/aspects/src/main/org/jboss/aspects/jmx/MBean.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/jmx/MBean.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/jmx/MBean.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -21,12 +21,19 @@
*/
package org.jboss.aspects.jmx;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
/**
- * JDK 1.5 annotation for triggering JMX aspect
+ * Comment
*
* @author <a href="mailto:bill at jboss.org">Bill Burke</a>
* @version $Revision$
*/
-public interface MBean
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target(ElementType.TYPE)
+public @interface MBean
{
}
Modified: trunk/aspects/src/main/org/jboss/aspects/patterns/readwritelock/readLockOperation.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/patterns/readwritelock/readLockOperation.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/patterns/readwritelock/readLockOperation.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -20,11 +20,19 @@
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.jboss.aspects.patterns.readwritelock;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
/**
* @version <tt>$Revision$</tt>
* @author <a href="mailto:chussenet at yahoo.com">{Claude Hussenet Independent Consultant}</a>.
*/
-public interface readLockOperation
+
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target(ElementType.METHOD)
+public @interface readLockOperation
{
}
Modified: trunk/aspects/src/main/org/jboss/aspects/patterns/readwritelock/writeLockOperation.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/patterns/readwritelock/writeLockOperation.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/patterns/readwritelock/writeLockOperation.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -21,11 +21,19 @@
*/
package org.jboss.aspects.patterns.readwritelock;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+
/**
* @version <tt>$Revision$</tt>
* @author <a href="mailto:chussenet at yahoo.com">{Claude Hussenet Independent Consultant}</a>.
*/
-public interface writeLockOperation
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target(ElementType.METHOD)
+public @interface writeLockOperation
{
}
Modified: trunk/aspects/src/main/org/jboss/aspects/security/Exclude.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/security/Exclude.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/security/Exclude.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -21,12 +21,16 @@
*/
package org.jboss.aspects.security;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
/**
*
* @author <a href="mailto:bill at jboss.org">Bill Burke</a>
* @version $Revision$
*/
-public interface Exclude {}
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface Exclude {}
Modified: trunk/aspects/src/main/org/jboss/aspects/security/Permissions.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/security/Permissions.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/security/Permissions.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -21,12 +21,16 @@
*/
package org.jboss.aspects.security;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
/**
*
* @author <a href="mailto:bill at jboss.org">Bill Burke</a>
* @version $Revision$
*/
-public interface Permissions
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface Permissions
{
String[] value();
}
Modified: trunk/aspects/src/main/org/jboss/aspects/security/RunAs.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/security/RunAs.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/security/RunAs.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -21,12 +21,15 @@
*/
package org.jboss.aspects.security;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
/**
*
* @author <a href="mailto:bill at jboss.org">Bill Burke</a>
* @version $Revision$
*/
-public interface RunAs
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface RunAs
{
String value();
}
Modified: trunk/aspects/src/main/org/jboss/aspects/security/SecurityDomain.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/security/SecurityDomain.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/security/SecurityDomain.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -21,10 +21,14 @@
*/
package org.jboss.aspects.security;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
/**
* JDK 1.4 annotation for JBoss security domain
- *
+ *
* See JBoss J2EE Security documentation for more info on security domains.
* Basically it specifies the repository where usernames, passwords, and
* user/role associtations are stored.
@@ -33,7 +37,8 @@
* @version $Revision$
*
**/
-public interface SecurityDomain
+ at Target({ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME)
+public @interface SecurityDomain
{
String value();
}
Modified: trunk/aspects/src/main/org/jboss/aspects/security/Unchecked.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/security/Unchecked.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/security/Unchecked.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -21,12 +21,16 @@
*/
package org.jboss.aspects.security;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
/**
*
* @author <a href="mailto:bill at jboss.org">Bill Burke</a>
* @version $Revision$
*/
-public interface Unchecked {}
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface Unchecked {}
Modified: trunk/aspects/src/main/org/jboss/aspects/tx/Tx.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/tx/Tx.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/tx/Tx.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -20,12 +20,17 @@
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.jboss.aspects.tx;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
/**
*
* @author <a href="mailto:bill at jboss.org">Bill Burke</a>
* @version $Revision$
*/
-public interface Tx
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface Tx
{
- TxType value();
+ TxType value() default TxType.REQUIRED;
}
Modified: trunk/aspects/src/main/org/jboss/aspects/tx/TxLocal.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/tx/TxLocal.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/tx/TxLocal.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -21,6 +21,11 @@
*/
package org.jboss.aspects.tx;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
/**
* This is an aspect-oriented annotation and triggers certain behavior.
*
@@ -37,6 +42,7 @@
* @author <a href="mailto:bill at jboss.org">Bill Burke</a>
* @version $Revision$
*/
-public interface TxLocal
+ at Target({ElementType.FIELD}) @Retention(RetentionPolicy.RUNTIME)
+public @interface TxLocal
{
}
Modified: trunk/aspects/src/main/org/jboss/aspects/tx/TxType.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/tx/TxType.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/tx/TxType.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -26,24 +26,12 @@
* @author <a href="mailto:bill at jboss.org">Bill Burke</a>
* @version $Revision$
*/
-public class TxType extends org.jboss.lang.Enum
+public enum TxType
{
- public static final TxType MANDATORY = new TxType("MANDATORY", 0);
- public static final TxType REQUIRED = new TxType("REQUIRED", 1);
- public static final TxType REQUIRESNEW = new TxType("REQUIRESNEW", 2);
- public static final TxType SUPPORTS = new TxType("SUPPORTS", 3);
- public static final TxType NOTSUPPORTED = new TxType("NOTSUPPORTED", 4);
- public static final TxType NEVER = new TxType("NEVER", 5);
-
- private static final TxType[] values = {MANDATORY, REQUIRED, REQUIRESNEW, SUPPORTS, NOTSUPPORTED, NEVER};
-
- private TxType(String name, int ordinal)
- {
- super(name, ordinal);
- }
-
- Object readResolve() throws java.io.ObjectStreamException
- {
- return values[ordinal];
- }
+ MANDATORY,
+ REQUIRED,
+ REQUIRESNEW,
+ SUPPORTS,
+ NOTSUPPORTED,
+ NEVER
}
Modified: trunk/aspects/src/main/org/jboss/aspects/txlock/TxSynchronized.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/txlock/TxSynchronized.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/main/org/jboss/aspects/txlock/TxSynchronized.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -21,9 +21,13 @@
*/
package org.jboss.aspects.txlock;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
/**
*
* @author <a href="mailto:bill at jboss.org">Bill Burke</a>
* @version $Revision$
*/
-public interface TxSynchronized {}
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface TxSynchronized {}
Added: trunk/aspects/src/resources/META-INF/aspect-deployer-beans.xml
===================================================================
--- trunk/aspects/src/resources/META-INF/aspect-deployer-beans.xml 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/resources/META-INF/aspect-deployer-beans.xml 2006-10-20 16:25:45 UTC (rev 57757)
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Aspect Deployer
+-->
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+ <bean name="AspectManager" class="org.jboss.aop.deployers.AspectManager">
+ <property name="mbeanServer"><inject bean="JMXKernel" property="mbeanServer"/></property>
+ <property name="enableLoadtimeWeaving">false</property>
+ <!-- only relevant when EnableLoadtimeWeaving is true.
+ When transformer is on, every loaded class gets
+ transformed. If AOP can't find the class, then it
+ throws an exception. Sometimes, classes may not have
+ all the classes they reference. So, the Suppressing
+ is needed. (i.e. Jboss cache in the default configuration -->
+ <property name="suppressTransformationErrors">true</property>
+ <property name="prune">true</property>
+ <property name="include">org.jboss.test, org.jboss.injbossaop</property>
+ <property name="exclude">org.jboss.</property>
+ <!-- This avoids instrumentation of hibernate cglib enhanced proxies
+ <property name="ignore">*$$EnhancerByCGLIB$$*</property> -->
+ <property name="optimized">true</property>
+ <property name="verbose">false</property>
+ <!--
+ Available choices for this attribute are:
+ org.jboss.aop.instrument.ClassicInstrumentor (default)
+ org.jboss.aop.instrument.GeneratedAdvisorInstrumentor
+ <property name="instrumentor">org.jboss.aop.instrument.ClassicInstrumentor</property>
+ -->
+ </bean>
+
+
+
+ <!-- Aspect Deployment -->
+ <bean name="AspectDeployer" class="org.jboss.aop.deployers.AspectDeployer">
+ <install bean="MainDeployer" method="addDeployer">
+ <parameter><this/></parameter>
+ </install>
+ <uninstall bean="MainDeployer" method="removeDeployer">
+ <parameter><this/></parameter>
+ </uninstall>
+ <depends>AspectManager</depends>
+ </bean>
+</deployment>
Deleted: trunk/aspects/src/resources/META-INF/aspect-deployers-beans.xml
===================================================================
--- trunk/aspects/src/resources/META-INF/aspect-deployers-beans.xml 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/aspects/src/resources/META-INF/aspect-deployers-beans.xml 2006-10-20 16:25:45 UTC (rev 57757)
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- Aspect Deployer
--->
-<deployment xmlns="urn:jboss:bean-deployer:2.0">
- <bean name="AspectManager" class="org.jboss.aop.deployers.AspectManager">
- <property name="mbeanServer"><inject bean="JMXKernel" property="mbeanServer"/></property>
- <property name="enableLoadtimeWeaving">false</property>
- <!-- only relevant when EnableLoadtimeWeaving is true.
- When transformer is on, every loaded class gets
- transformed. If AOP can't find the class, then it
- throws an exception. Sometimes, classes may not have
- all the classes they reference. So, the Suppressing
- is needed. (i.e. Jboss cache in the default configuration -->
- <property name="suppressTransformationErrors">true</property>
- <property name="prune">true</property>
- <property name="include">org.jboss.test, org.jboss.injbossaop</property>
- <property name="exclude">org.jboss.</property>
- <!-- This avoids instrumentation of hibernate cglib enhanced proxies
- <property name="ignore">*$$EnhancerByCGLIB$$*</property> -->
- <property name="optimized">true</property>
- <property name="verbose">false</property>
- <!--
- Available choices for this attribute are:
- org.jboss.aop.instrument.ClassicInstrumentor (default)
- org.jboss.aop.instrument.GeneratedAdvisorInstrumentor
- <property name="instrumentor">org.jboss.aop.instrument.ClassicInstrumentor</property>
- -->
- </bean>
-
-
-
- <!-- Aspect Deployment -->
- <bean name="AspectDeployer" class="org.jboss.aop.deployers.AspectDeployer">
- <install bean="MainDeployer" method="addDeployer">
- <parameter><this/></parameter>
- </install>
- <uninstall bean="MainDeployer" method="removeDeployer">
- <parameter><this/></parameter>
- </uninstall>
- <depends>AspectManager</depends>
- </bean>
-</deployment>
Modified: trunk/build/build-distr.xml
===================================================================
--- trunk/build/build-distr.xml 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/build/build-distr.xml 2006-10-20 16:25:45 UTC (rev 57757)
@@ -249,6 +249,7 @@
<property name="_module.output" override="true"
value="${project.root}/${_module.name}/output"/>
+ <!--
<condition property="aop.deployer" value="jboss-aop-jdk50.deployer">
<isset property="HAVE_JDK_1.5"/>
</condition>
@@ -258,15 +259,12 @@
<isset property="HAVE_JDK_1.5"/>
</not>
</condition>
-
+ -->
+ <property name="aop.deployer" value="jboss-aop-jboss5.deployer"/>
<!-- Copy the generated libraries -->
<unjar src="${_module.output}/lib/${aop.deployer}"
dest="${install.server}/all/deployers/${aop.deployer}" />
- <move file="${install.server}/all/deployers/${aop.deployer}/base-aop.xml"
- tofile="${install.server}/all/deployers/${aop.deployer}/base-aspects.xml"/>
-
-
<!-- Copy across client jars -->
<mkdir dir="${install.client}"/>
<copy todir="${install.client}" filtering="no">
Modified: trunk/build/build-thirdparty.xml
===================================================================
--- trunk/build/build-thirdparty.xml 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/build/build-thirdparty.xml 2006-10-20 16:25:45 UTC (rev 57757)
@@ -84,7 +84,8 @@
<componentref name="jacorb" version="2.2.4jboss.patch1"/>
<componentref name="javassist" version="snapshot"/>
<componentref name="jaxen" version="1.1-beta-9"/>
- <componentref name="jboss/aop" version="2.0.0.alpha1"/>
+ <componentref name="jboss/aop" version="snapshot"/>
+ <componentref name="jboss/aop14" version="snapshot"/>
<componentref name="jboss/backport-concurrent" version="2.1.0.GA"/>
<componentref name="jboss/cache" version="snapshot"/>
<componentref name="jboss/common-core" version="2.0.2.CR1"/>
@@ -98,6 +99,7 @@
<componentref name="jboss/microcontainer" version="snapshot"/>
<componentref name="jboss/microcontainer14" version="snapshot"/>
<componentref name="jboss/remoting" version="1.4.3.GA"/>
+ <componentref name="jboss/jbossretro" version="1.0.4.GA"/>
<componentref name="jboss/security-spi" version="snapshot"/>
<componentref name="jboss/security" version="snapshot"/>
<componentref name="jboss/serialization" version="1.0.1.GA"/>
Modified: trunk/testsuite/.classpath
===================================================================
--- trunk/testsuite/.classpath 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/testsuite/.classpath 2006-10-20 16:25:45 UTC (rev 57757)
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry excluding="org/jboss/test/aop/bean/AnnotatedSecuredPOJO.java|org/jboss/test/aop/bean/OverriddenAnnotation.java|org/jboss/test/aop/bean/AnnotatedTxLockedPOJO.java|org/jboss/test/aop/bean/AnnotatedTxPOJO.java|org/jboss/test/recover/derby/EmbeddedDerbyRecoverable.java|org/jboss/test/recover/oracle/OracleRecoverable.java|org/jboss/test/security/test/HttpsUnitTestCase.java" kind="src" path="src/main"/>
- <classpathentry kind="src" path="src/jdk15"/>
+ <classpathentry excluding="org/jboss/test/recover/derby/EmbeddedDerbyRecoverable.java|org/jboss/test/recover/oracle/OracleRecoverable.java|org/jboss/test/security/test/HttpsUnitTestCase.java" kind="src" path="src/main"/>
<classpathentry kind="lib" path="src/resources"/>
<classpathentry kind="lib" path="/thirdparty/apache-xerces/lib/xml-apis.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
@@ -74,8 +73,6 @@
<classpathentry combineaccessrules="false" kind="src" path="/system-jmx"/>
<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-deployers.jar"/>
<classpathentry kind="lib" path="/thirdparty/jboss/aop/lib/jboss-aop-jdk50.jar"/>
- <classpathentry kind="lib" path="/thirdparty/jboss/aop/lib/jboss-aop.jar"/>
- <classpathentry kind="lib" path="/thirdparty/jboss/aop/lib/jdk14-pluggable-instrumentor.jar"/>
<classpathentry kind="lib" path="/thirdparty/jboss/aop/lib/pluggable-instrumentor.jar"/>
<classpathentry kind="output" path="output/eclipse-classes"/>
</classpath>
Modified: trunk/testsuite/build.xml
===================================================================
--- trunk/testsuite/build.xml 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/testsuite/build.xml 2006-10-20 16:25:45 UTC (rev 57757)
@@ -363,14 +363,6 @@
<target name="compile-annotated-classes-50" if="HAVE_JDK_1.5">
<mkdir dir="${build.classes}"/>
- <!-- Make sure that jdk 50 aspect library and jboss aop comes first, since these contains the
- JDK 5 version of the annotation types
- -->
- <path id="annotations.classpath">
- <pathelement path="${jboss.aspects.lib}/jboss-aspect-library-jdk50.jar"/>
- <pathelement path="${jboss.aop.lib}/jboss-aop-jdk50.jar"/>
- <path refid="tests.classpath"/>
- </path>
<javac destdir="${build.classes}"
optimize="${javac.optimize}"
source="1.5"
@@ -383,8 +375,32 @@
includeJavaRuntime="${javac.include.java.runtime}"
failonerror="${javac.fail.onerror}">
<src path="${source.java.5}"/>
+ <classpath refid="tests.classpath"/>
+ <include name="org/jboss/test/aop/**"/>
+ </javac>
+
+ <!-- The aop tests use JDK 5 annotations, so make sure that the jboss-aop-jdk50.jar comes before the JDK1.4 style annotations defined in jboss-messaging-client.jar -->
+ <path id="annotations.classpath">
+ <path refid="jboss.aop.classpath"/>
+ <path refid="tests.classpath"/>
+ </path>
+
+ <javac destdir="${build.classes}"
+ optimize="${javac.optimize}"
+ source="1.5"
+ target="1.5"
+ debug="${javac.debug}"
+ depend="${javac.depend}"
+ verbose="${javac.verbose}"
+ deprecation="${javac.deprecation}"
+ includeAntRuntime="${javac.include.ant.runtime}"
+ includeJavaRuntime="${javac.include.java.runtime}"
+ failonerror="${javac.fail.onerror}">
+ <src path="${source.java}"/>
<classpath refid="annotations.classpath"/>
+ <include name="org/jboss/test/aop/**"/>
</javac>
+
</target>
<target name="compile-classes-only" depends="compile-annotated-classes-50">
@@ -404,8 +420,8 @@
<src path="${build.gen-src}"/>
<exclude name="org/jboss/test/recover/oracle/**"/>
<exclude name="org/jboss/test/recover/derby/**"/>
- <exclude name="org/jboss/test/aop/bean/Annotated*" if="HAVE_JDK_1.5"/>
- <exclude name="org/jboss/test/xml/JaxpXPathBaseTestCase*" if="HAVE_JDK_1.4"/>
+ <exclude name="org/jboss/test/xml/JaxpXPathBaseTestCase*" if="HAVE_JDK_1.4"/>
+ <exclude name="org/jboss/test/aop/**"/>
<classpath refid="tests.classpath"/>
</javac>
</target>
@@ -640,7 +656,7 @@
<patternset id="jacc.excludes">
<exclude name="**/test/jacc/test/*"/>
</patternset>
- <patternset id="ldap.includes">
+ <patternset id="ldap.includes">
<include name="**/test/security/test/opends/*TestCase.class"/>
</patternset>
<patternset id="jaxr.includes">
@@ -921,7 +937,7 @@
<!-- Test a TCP_NIO stack.-->
<antcall target="tests-clustering">
<param name="jboss-junit-configuration" value="tcp_nio"/>
- </antcall>
+ </antcall>
</target>
<!-- Depending on the value of the ${jboss-junit-configuration} variable, uses different JGroups stacks -->
@@ -2443,7 +2459,7 @@
<!-- Ldap Tests-->
<target name="tests-ldap"
- description="Tests run against a jboss server with opends configured">
+ description="Tests run against a jboss server with opends configured">
<create-config baseconf="default" newconf="opends">
<patternset>
<include name="conf/**"/>
@@ -2463,7 +2479,7 @@
<include name="deploy/properties**"/>
<include name="lib/**"/>
</patternset>
- </create-config>
+ </create-config>
<copy file="${build.lib}/opends.sar"
todir="${jboss.dist}/server/opends/deploy" />
@@ -2472,11 +2488,11 @@
<mkdir dir="${build.reports}"/>
<mkdir dir="${build.testlog}"/>
- <property name="jbosstest.secure" value="true"/>
+ <property name="jbosstest.secure" value="true"/>
<property name="java.security.auth.login.config"
- value="${build.resources}/security/auth.conf"/>
+ value="${build.resources}/security/auth.conf"/>
<property name="jboss.security.ldap.ctxfactory"
- value="com.sun.jndi.ldap.LdapCtxFactory"/>
+ value="com.sun.jndi.ldap.LdapCtxFactory"/>
<propertyset id="opends-tests-props">
<propertyref prefix="java.security.auth"/>
@@ -2484,8 +2500,8 @@
</propertyset>
<run-junit junit.patternset="ldap.includes"
junit.configuration="opends"
- junit.syspropertyset="opends-tests-props" />
- <server:stop name="opends"/>
+ junit.syspropertyset="opends-tests-props" />
+ <server:stop name="opends"/>
</target>
@@ -3133,12 +3149,12 @@
if="HAVE_JDK_1.5">
<!-- copy across the pluggable instrumentor -->
- <copy todir="${jboss.dist}/bin" file="${jboss.aop.lib}/pluggable-instrumentor.jar"/>
- <server:start name="scoped-aop-jdk50"/>
+ <!--copy todir="${jboss.dist}/bin" file="${jboss.aop.lib}/pluggable-instrumentor.jar"/>
+ <server:start name="scoped-aop-jdk50"/-->
<run-junit junit.patternset="aop-with-classloader.includes"/>
- <server:stop name="scoped-aop-jdk50"/>
+ <!--server:stop name="scoped-aop-jdk50"/-->
<delete file="${jboss.dist}/bin/pluggable-instrumentor.jar"/>
</target>
@@ -3220,7 +3236,7 @@
<sysproperty key="build.testlog" value="${build.testlog}"/>
<sysproperty key="log4j.configuration" value="file:${build.resources}/log4j.xml"/>
<sysproperty key="java.naming.provider.url" value="${node0.jndi.url}"/>
- <sysproperty key="jbosstest.server.host" value="${node0}"/>
+ <sysproperty key="jbosstest.server.host" value="${node0}"/>
<!-- Pass along any jbosstest.* system properties -->
<syspropertyset>
<propertyref prefix="jbosstest."/>
Modified: trunk/testsuite/imports/sections/aop.xml
===================================================================
--- trunk/testsuite/imports/sections/aop.xml 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/testsuite/imports/sections/aop.xml 2006-10-20 16:25:45 UTC (rev 57757)
@@ -14,16 +14,7 @@
<path refid="jboss.common.logging.log4j.classpath"/>
<path refid="jboss.common.logging.jdk.classpath"/>
</path>
- <taskdef name="annotationc" classname="org.jboss.aop.ant.AnnotationC"
- classpathref="jboss.aop.classpath"/>
- <annotationc compilerclasspathref="aop.task.classpath" bytecode="true">
- <classpath refid="thirdparty.classpath"/>
- <classpath path="${build.classes}"/>
- <src path="${source.java}"/>
- <include name="org/jboss/test/aop/bean/AnnotatedSecuredPOJO.java"/>
- <include name="org/jboss/test/aop/bean/AnnotatedTxPOJO.java"/>
- <include name="org/jboss/test/aop/bean/AnnotatedTxLockedPOJO.java"/>
- </annotationc>
+ <antcall target="compile-aop-annotatations"/>
<!-- build aopest.jar -->
<jar destfile="${build.lib}/aoptest.jar"
manifest="${build.etc}/manifest.mf">
@@ -257,7 +248,7 @@
<include name="META-INF/jboss-service.xml"/>
</fileset>
</jar>
-
+
<jar destfile="${build.lib}/aop-scopedear1-ejb.jar">
<fileset dir="${build.classes}">
<include name="org/jboss/test/aop/scoped/ear/ejb/*.class"/>
@@ -331,11 +322,11 @@
<include name="META-INF/jboss-app.xml"/>
</fileset>
</jar>
-
-
- <!-- ************************ -->
+
+
+ <!-- ************************ -->
<!-- jars for extender test -->
- <!-- *********************** -->
+ <!-- *********************** -->
<jar destfile="${build.lib}/aop-extendertest.aop">
<fileset dir="${build.classes}">
<include name="org/jboss/test/aop/extender/*.class"/>
@@ -356,11 +347,11 @@
<include name="META-INF/jboss-service.xml"/>
</fileset>
</jar>
-
-
- <!-- **************************** -->
+
+
+ <!-- **************************** -->
<!-- jars for scopedextender test -->
- <!-- **************************** -->
+ <!-- **************************** -->
<!-- Create aop and jar for base sar-->
<jar destfile="${build.lib}/aop-scopedextender-base.jar">
<fileset dir="${build.classes}">
@@ -376,7 +367,7 @@
</jar>
<!-- Create aop and jar for child sar-->
<jar destfile="${build.lib}/aop-scopedextender-child.jar">
- <fileset dir="${build.classes}">
+ <fileset dir="${build.classes}">
<include name="org/jboss/test/aop/scopedextender/Child*.class"/>
<include name="org/jboss/test/aop/scopedextender/ScopedChild*.class"/>
<exclude name="org/jboss/test/aop/scopedextender/*Tester*.class"/>
@@ -452,7 +443,7 @@
<include name="META-INF/jboss-service.xml"/>
</fileset>
</jar>
-
+
<!-- ok, we have created the loadtime jars, let us now precompile the classes for standalone test -->
<!--
<aopc compilerclasspathref="aop.task.classpath">
@@ -465,4 +456,16 @@
-->
</target>
+ <target name="compile-aop-annotatations" unless="HAVE_JDK_1.5">
+ <taskdef name="annotationc" classname="org.jboss.aop.ant.AnnotationC"
+ classpathref="jboss.aop.classpath"/>
+ <annotationc compilerclasspathref="aop.task.classpath" bytecode="true">
+ <classpath refid="thirdparty.classpath"/>
+ <classpath path="${build.classes}"/>
+ <src path="${source.java}"/>
+ <include name="org/jboss/test/aop/bean/AnnotatedSecuredPOJO.java"/>
+ <include name="org/jboss/test/aop/bean/AnnotatedTxPOJO.java"/>
+ <include name="org/jboss/test/aop/bean/AnnotatedTxLockedPOJO.java"/>
+ </annotationc>
+ </target>
</project>
Modified: trunk/testsuite/src/main/org/jboss/test/aop/bean/AnnotatedSecuredPOJO.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/aop/bean/AnnotatedSecuredPOJO.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/testsuite/src/main/org/jboss/test/aop/bean/AnnotatedSecuredPOJO.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -1,83 +1,69 @@
/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.
- */
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.aop.bean;
+import org.jboss.aspects.security.SecurityDomain;
+import org.jboss.aspects.security.Permissions;
+import org.jboss.aspects.security.Exclude;
+import org.jboss.aspects.security.Unchecked;
+
/**
- * @@org.jboss.aspects.security.SecurityDomain ("other")
- *
- * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ * @author <a href="mailto:kabir.khan at jboss.org">Kabir Khan</a>
* @version $Revision$
*/
+ at SecurityDomain ("other")
public class AnnotatedSecuredPOJO
{
- /**
- * @@org.jboss.aspects.security.Permissions ({"allowed"})
- */
+ @Permissions ({"allowed"})
public int someField;
- /**
- * @@org.jboss.aspects.security.Exclude
- */
+ @Exclude
public String excludedField;
- /**
- * @@org.jboss.aspects.security.Unchecked
- */
+ @Unchecked
public long uncheckedField;
- /**
- * @@org.jboss.aspects.security.Unchecked
- */
+ @Unchecked
public AnnotatedSecuredPOJO()
{
}
- /**
- * @@org.jboss.aspects.security.Permissions ({"allowed"})
- */
+ @Permissions ({"allowed"})
public AnnotatedSecuredPOJO(int field)
{
someField = field;
}
- /**
- * @@org.jboss.aspects.security.Exclude
- */
+ @Exclude
public AnnotatedSecuredPOJO(String field) {}
- /**
- * @@org.jboss.aspects.security.Unchecked
- */
+ @Unchecked
public void unchecked() {}
- /**
- * @@org.jboss.aspects.security.Permissions ({"allowed"})
- */
+ @Permissions ({"allowed"})
public void someMethod() {}
- /**
- * @@org.jboss.aspects.security.Exclude
- */
+ @Exclude
public void excluded() {}
}
Modified: trunk/testsuite/src/main/org/jboss/test/aop/bean/AnnotatedTxLockedPOJO.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/aop/bean/AnnotatedTxLockedPOJO.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/testsuite/src/main/org/jboss/test/aop/bean/AnnotatedTxLockedPOJO.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -1,29 +1,32 @@
/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.
- */
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.aop.bean;
+import org.jboss.aspects.tx.Tx;
+import org.jboss.aspects.txlock.TxSynchronized;
+import org.jboss.aspects.tx.TxType;
+
/**
- *
- * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ * @author <a href="mailto:kabir.khan at jboss.org">Kabir Khan</a>
* @version $Revision$
*/
public class AnnotatedTxLockedPOJO
@@ -38,12 +41,8 @@
public int getField() { return field; }
- /**
- * @@org.jboss.aspects.tx.Tx (org.jboss.aspects.tx.TxType.REQUIRED)
- * @@org.jboss.aspects.txlock.TxSynchronized
- *
- * @param val
- */
+ @Tx (TxType.REQUIRED)
+ @TxSynchronized
public void setField(int val)
{
if (val == 6 && field == 0)
Modified: trunk/testsuite/src/main/org/jboss/test/aop/bean/AnnotatedTxPOJO.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/aop/bean/AnnotatedTxPOJO.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/testsuite/src/main/org/jboss/test/aop/bean/AnnotatedTxPOJO.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -1,37 +1,40 @@
/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.
- */
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.aop.bean;
+import org.jboss.aspects.tx.Tx;
+import org.jboss.aspects.txlock.TxSynchronized;
+import org.jboss.aspects.tx.TxType;
+import org.jboss.tm.TxUtils;
+
import javax.naming.InitialContext;
import javax.transaction.Transaction;
import javax.transaction.TransactionManager;
-import org.jboss.tm.TxUtils;
/**
- * @@org.jboss.aspects.tx.Tx (org.jboss.aspects.tx.TxType.NOTSUPPORTED)
- *
- * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ * @author <a href="mailto:kabir.khan at jboss.org">Kabir Khan</a>
* @version $Revision$
*/
+ at Tx (TxType.NOTSUPPORTED)
public class AnnotatedTxPOJO
{
TransactionManager tm;
@@ -41,9 +44,7 @@
tm = (TransactionManager)new InitialContext().lookup("java:/TransactionManager");
}
- /**
- * @@org.jboss.aspects.tx.Tx (org.jboss.aspects.tx.TxType.NEVER)
- */
+ @Tx (TxType.NEVER)
public void never() {}
public void callNever() throws Exception
@@ -59,12 +60,10 @@
exceptionThrown = true;
}
tm.commit();
- if (!exceptionThrown) throw new Exception("failed on never no tx call");
+ if (!exceptionThrown) throw new Exception("failed on mandatory no tx call");
}
- /**
- * @@org.jboss.aspects.tx.Tx (org.jboss.aspects.tx.TxType.NOTSUPPORTED)
- */
+ @Tx (TxType.NOTSUPPORTED)
public void notsupported() throws Exception
{
if (tm.getTransaction() != null) throw new Exception("notsupported() method has tx set");
@@ -77,9 +76,7 @@
tm.commit();
}
- /**
- * @@org.jboss.aspects.tx.Tx (org.jboss.aspects.tx.TxType.SUPPORTS)
- */
+ @Tx (TxType.SUPPORTS)
public void supports(Transaction tx) throws Exception
{
Transaction tmTx = tm.getTransaction();
@@ -114,18 +111,14 @@
supports(null);
}
- /**
- * @@org.jboss.aspects.tx.Tx (org.jboss.aspects.tx.TxType.REQUIRED)
- */
+ @Tx (TxType.REQUIRED)
public void required() throws Exception
{
if (tm.getTransaction() == null) throw new Exception("rquired() method has no tx set");
}
- /**
- * @@org.jboss.aspects.tx.Tx (org.jboss.aspects.tx.TxType.REQUIRESNEW)
- */
+ @Tx (TxType.REQUIRESNEW)
public void requiresNew(Transaction tx) throws Exception
{
Transaction tmTx = tm.getTransaction();
@@ -141,9 +134,7 @@
tm.commit();
}
- /**
- * @@org.jboss.aspects.tx.Tx (org.jboss.aspects.tx.TxType.MANDATORY)
- */
+ @Tx (TxType.MANDATORY)
public void mandatory() {}
public void callMandatoryNoTx() throws Exception
Modified: trunk/testsuite/src/main/org/jboss/test/aop/bean/OverriddenAnnotation.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/aop/bean/OverriddenAnnotation.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/testsuite/src/main/org/jboss/test/aop/bean/OverriddenAnnotation.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -26,8 +26,7 @@
* @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
* @version $Revision$
*/
-public interface OverriddenAnnotation
-{
+public @interface OverriddenAnnotation {
String data();
}
Added: trunk/testsuite/src/main/org/jboss/test/aop/deployers/DeployersMonitor.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/aop/deployers/DeployersMonitor.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/testsuite/src/main/org/jboss/test/aop/deployers/DeployersMonitor.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -0,0 +1,102 @@
+/*
+* 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.test.aop.deployers;
+
+import java.util.Map;
+import java.util.TreeMap;
+
+import org.jboss.aop.AspectManager;
+import org.jboss.aop.advice.AdviceBinding;
+import org.jboss.aop.advice.AspectDefinition;
+import org.jboss.aop.advice.AspectFactory;
+import org.jboss.aop.advice.GenericAspectFactory;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class DeployersMonitor implements DeployersMonitorMBean
+{
+ AspectManager manager = AspectManager.instance();
+
+ public Map<String, String> getCurrentBindings()
+ {
+ Map<String, String> result = new TreeMap<String, String>();
+ Map bindings = manager.getBindings();
+ for (Object binding : bindings.values())
+ {
+ String key = ((AdviceBinding)binding).getName();
+ String poincut = ((AdviceBinding)binding).getPointcut().getExpr();
+ result.put(key, poincut);
+ }
+
+ return result;
+ }
+
+ public Map<String, String> getCurrentAspectDefinitions()
+ {
+ Map<String, String> result = new TreeMap();
+ Map definitions = manager.getAspectDefinitions();
+ for (Object def : definitions.values())
+ {
+ AspectFactory factory = ((AspectDefinition)def).getFactory();
+
+ if (factory instanceof GenericAspectFactory)
+ {
+ String key = ((AspectDefinition)def).getName();
+ String clazz = ((GenericAspectFactory)factory).getClassname();
+ result.put(key, clazz);
+ }
+ }
+
+ return result;
+ }
+
+ public void invokeXmlPOJO() throws Exception
+ {
+ org.jboss.test.aop.deployers.xml.POJO pojo = new org.jboss.test.aop.deployers.xml.POJO();
+ org.jboss.test.aop.deployers.xml.POJO.invoked = false;
+ org.jboss.test.aop.deployers.xml.SomeInterceptor.invoked = 0;
+ org.jboss.test.aop.deployers.xml.SomeAspect.invoked = 0;
+
+ pojo.someMethod();
+
+ if (org.jboss.test.aop.deployers.xml.SomeInterceptor.invoked != 2) throw new RuntimeException("SomeInterceptor should have intercepted 2 times not " + org.jboss.test.aop.deployers.xml.SomeInterceptor.invoked);
+ if (org.jboss.test.aop.deployers.xml.SomeAspect.invoked != 2) throw new RuntimeException("SomeAspect should have intercepted 2 times not " + org.jboss.test.aop.deployers.xml.SomeAspect.invoked);
+ if (!org.jboss.test.aop.deployers.xml.POJO.invoked) throw new RuntimeException("POJO was not called");
+ }
+
+ public void invokeAnnotationPOJO() throws Exception
+ {
+ org.jboss.test.aop.deployers.annotations.POJO pojo = new org.jboss.test.aop.deployers.annotations.POJO();
+ org.jboss.test.aop.deployers.annotations.POJO.invoked = false;
+ org.jboss.test.aop.deployers.annotations.SomeInterceptor.invoked = 0;
+ org.jboss.test.aop.deployers.annotations.SomeAspect.invoked = 0;
+
+ pojo.someMethod();
+
+ if (org.jboss.test.aop.deployers.annotations.SomeInterceptor.invoked != 1) throw new RuntimeException("SomeInterceptor should have intercepted 1 times not " + org.jboss.test.aop.deployers.annotations.SomeInterceptor.invoked);
+ if (org.jboss.test.aop.deployers.annotations.SomeAspect.invoked != 1) throw new RuntimeException("SomeAspect should have intercepted 1 times not " + org.jboss.test.aop.deployers.annotations.SomeAspect.invoked);
+ if (!org.jboss.test.aop.deployers.annotations.POJO.invoked) throw new RuntimeException("POJO was not called");
+ }
+}
Added: trunk/testsuite/src/main/org/jboss/test/aop/deployers/DeployersMonitorMBean.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/aop/deployers/DeployersMonitorMBean.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/testsuite/src/main/org/jboss/test/aop/deployers/DeployersMonitorMBean.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -0,0 +1,37 @@
+/*
+* 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.test.aop.deployers;
+
+import java.util.Map;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public interface DeployersMonitorMBean
+{
+ Map<String, String> getCurrentBindings();
+ Map<String, String> getCurrentAspectDefinitions();
+ void invokeXmlPOJO() throws Exception;
+ void invokeAnnotationPOJO() throws Exception;
+}
Added: trunk/testsuite/src/main/org/jboss/test/aop/deployers/annotations/POJO.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/aop/deployers/annotations/POJO.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/testsuite/src/main/org/jboss/test/aop/deployers/annotations/POJO.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -0,0 +1,36 @@
+/*
+* 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.test.aop.deployers.annotations;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class POJO
+{
+ public static boolean invoked;
+ public void someMethod()
+ {
+ invoked = true;
+ }
+}
Added: trunk/testsuite/src/main/org/jboss/test/aop/deployers/annotations/SomeAspect.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/aop/deployers/annotations/SomeAspect.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/testsuite/src/main/org/jboss/test/aop/deployers/annotations/SomeAspect.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -0,0 +1,45 @@
+/*
+* 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.test.aop.deployers.annotations;
+
+import org.jboss.aop.Aspect;
+import org.jboss.aop.Bind;
+import org.jboss.aop.joinpoint.Invocation;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+ at Aspect
+public class SomeAspect
+{
+ public static int invoked;
+
+ @Bind(pointcut="execution(* org.jboss.test.aop.deployers.annotations.POJO->someMethod())")
+ public Object invoke(Invocation invocation) throws Throwable
+ {
+ invoked++;
+ return invocation.invokeNext();
+ }
+
+}
Added: trunk/testsuite/src/main/org/jboss/test/aop/deployers/annotations/SomeInterceptor.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/aop/deployers/annotations/SomeInterceptor.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/testsuite/src/main/org/jboss/test/aop/deployers/annotations/SomeInterceptor.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -0,0 +1,50 @@
+/*
+* 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.test.aop.deployers.annotations;
+
+import org.jboss.aop.Bind;
+import org.jboss.aop.InterceptorDef;
+import org.jboss.aop.advice.Interceptor;
+import org.jboss.aop.joinpoint.Invocation;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+ at InterceptorDef
+ at Bind(pointcut="execution(void org.jboss.test.aop.deployers.annotations.POJO->someMethod())")
+public class SomeInterceptor implements Interceptor
+{
+ public static int invoked;
+ public String getName()
+ {
+ return this.getClass().getName();
+ }
+
+ public Object invoke(Invocation invocation) throws Throwable
+ {
+ invoked++;
+ return invocation.invokeNext();
+ }
+
+}
Added: trunk/testsuite/src/main/org/jboss/test/aop/deployers/xml/POJO.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/aop/deployers/xml/POJO.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/testsuite/src/main/org/jboss/test/aop/deployers/xml/POJO.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -0,0 +1,36 @@
+/*
+* 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.test.aop.deployers.xml;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class POJO
+{
+ public static boolean invoked;
+ public void someMethod()
+ {
+ invoked = true;
+ }
+}
Added: trunk/testsuite/src/main/org/jboss/test/aop/deployers/xml/SomeAspect.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/aop/deployers/xml/SomeAspect.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/testsuite/src/main/org/jboss/test/aop/deployers/xml/SomeAspect.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -0,0 +1,42 @@
+/*
+* 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.test.aop.deployers.xml;
+
+import org.jboss.aop.advice.Interceptor;
+import org.jboss.aop.joinpoint.Invocation;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class SomeAspect
+{
+ public static int invoked;
+
+ public Object invoke(Invocation invocation) throws Throwable
+ {
+ invoked++;
+ return invocation.invokeNext();
+ }
+
+}
Added: trunk/testsuite/src/main/org/jboss/test/aop/deployers/xml/SomeInterceptor.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/aop/deployers/xml/SomeInterceptor.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/testsuite/src/main/org/jboss/test/aop/deployers/xml/SomeInterceptor.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -0,0 +1,46 @@
+/*
+* 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.test.aop.deployers.xml;
+
+import org.jboss.aop.advice.Interceptor;
+import org.jboss.aop.joinpoint.Invocation;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class SomeInterceptor implements Interceptor
+{
+ public static int invoked;
+ public String getName()
+ {
+ return this.getClass().getName();
+ }
+
+ public Object invoke(Invocation invocation) throws Throwable
+ {
+ invoked++;
+ return invocation.invokeNext();
+ }
+
+}
Added: trunk/testsuite/src/main/org/jboss/test/aop/test/DeployersInitialTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/aop/test/DeployersInitialTestCase.java 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/testsuite/src/main/org/jboss/test/aop/test/DeployersInitialTestCase.java 2006-10-20 16:25:45 UTC (rev 57757)
@@ -0,0 +1,203 @@
+/*
+* 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.test.aop.test;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+
+import javax.management.ObjectName;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.jboss.test.JBossTestCase;
+
+/**
+ * Test to see if things get deployed/undeployed correctly using the new deployers
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class DeployersInitialTestCase extends JBossTestCase
+{
+ final static ObjectName DEPLOYER_MONITOR;
+ static
+ {
+ try
+ {
+ DEPLOYER_MONITOR = new ObjectName("jboss.aop:service=DeployerMonitor");
+ }
+ catch (Exception e)
+ {
+ // AutoGenerated
+ throw new RuntimeException(e);
+ }
+ }
+
+ public DeployersInitialTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testAddXMLBindings() throws Exception
+ {
+ Map<String, String> initialBindings = (Map<String, String>)getServer().getAttribute(DEPLOYER_MONITOR, "CurrentBindings");
+ Map<String, String> initialDefinitiona = (Map<String, String>)getServer().getAttribute(DEPLOYER_MONITOR, "CurrentAspectDefinitions");
+
+ try
+ {
+ deploy("aop-deployertest-xml.aop");
+
+ Map<String, String> deployedBindings = (Map<String, String>)getServer().getAttribute(DEPLOYER_MONITOR, "CurrentBindings");
+ Map<String, String> deployedDefinitiona = (Map<String, String>)getServer().getAttribute(DEPLOYER_MONITOR, "CurrentAspectDefinitions");
+
+ Map<String, String> newBindings = getInEndOnly(initialBindings, deployedBindings);
+ assertEquals("Wrong number of new bindings", 2, newBindings.size());
+
+ Map<String, String> newDefinitions = getInEndOnly(initialDefinitiona, deployedDefinitiona);
+ assertEquals("Wrong number of new aspect definitions", 4, newDefinitions.size());
+
+ HashSet<String> bindings = new HashSet<String>();
+ bindings.addAll(newBindings.values());
+ assertTrue("Could not find 'execution(* org.jboss.test.aop.deployers.xml.POJO->someMethod())'", bindings.remove("execution(* org.jboss.test.aop.deployers.xml.POJO->someMethod())"));
+ assertTrue("Could not find 'execution(void org.jboss.test.aop.deployers.xml.POJO->someMethod())'", bindings.remove("execution(void org.jboss.test.aop.deployers.xml.POJO->someMethod())"));
+
+ String name = "someinterceptor";
+ String clazz = newDefinitions.get(name);
+ assertNotNull("No clazz found for " + name, clazz);
+ assertEquals("Wrong clazz for " + name, "org.jboss.test.aop.deployers.xml.SomeInterceptor", clazz);
+ newDefinitions.remove(name);
+
+ name = "someaspect";
+ clazz = newDefinitions.get(name);
+ assertNotNull("No clazz found for " + name, clazz);
+ assertEquals("Wrong clazz for " + name, "org.jboss.test.aop.deployers.xml.SomeAspect", clazz);
+ newDefinitions.remove(name);
+
+ assertEquals(2, newDefinitions.size());
+
+ HashSet<String> definitions = new HashSet<String>();
+ definitions.addAll(newDefinitions.values());
+ assertTrue("Could not find 'org.jboss.test.aop.deployers.xml.SomeInterceptor'", definitions.remove("org.jboss.test.aop.deployers.xml.SomeInterceptor"));
+ assertTrue("Could not find 'org.jboss.test.aop.deployers.xml.SomeAspect'", definitions.remove("org.jboss.test.aop.deployers.xml.SomeAspect"));
+
+ getServer().invoke(DEPLOYER_MONITOR, "invokeXmlPOJO", new Object[0], new String[0]);
+
+ }
+ catch(Exception e)
+ {
+ throw e;
+ }
+ finally
+ {
+ undeploy("aop-deployertest-xml.aop");
+ }
+
+ Map<String, String> finalBindings = (Map<String, String>)getServer().getAttribute(DEPLOYER_MONITOR, "CurrentBindings");
+ Map<String, String> finalAspectDefinitiona = (Map<String, String>)getServer().getAttribute(DEPLOYER_MONITOR, "CurrentAspectDefinitions");
+
+ compareSame(initialBindings, finalBindings);
+ compareSame(initialDefinitiona, finalAspectDefinitiona);
+ }
+
+ public void testAddAnnotationBindings() throws Exception
+ {
+ Map<String, String> initialBindings = (Map<String, String>)getServer().getAttribute(DEPLOYER_MONITOR, "CurrentBindings");
+ Map<String, String> initialDefinitiona = (Map<String, String>)getServer().getAttribute(DEPLOYER_MONITOR, "CurrentAspectDefinitions");
+
+ try
+ {
+ deploy("aop-deployertest-annotations.aop");
+ Map<String, String> deployedBindings = (Map<String, String>)getServer().getAttribute(DEPLOYER_MONITOR, "CurrentBindings");
+ Map<String, String> deployedDefinitiona = (Map<String, String>)getServer().getAttribute(DEPLOYER_MONITOR, "CurrentAspectDefinitions");
+
+ Map<String, String> newBindings = getInEndOnly(initialBindings, deployedBindings);
+ assertEquals("Wrong number of new bindings", 2, newBindings.size());
+
+ Map<String, String> newDefinitions = getInEndOnly(initialDefinitiona, deployedDefinitiona);
+ assertEquals("Wrong number of new aspect definitions", 2, newDefinitions.size());
+
+ HashSet<String> bindings = new HashSet<String>();
+ bindings.addAll(newBindings.values());
+ assertTrue("Could not find 'execution(* org.jboss.test.aop.deployers.annotations.POJO->someMethod())'", bindings.remove("execution(* org.jboss.test.aop.deployers.annotations.POJO->someMethod())"));
+ assertTrue("Could not find 'execution(void org.jboss.test.aop.deployers.annotations.POJO->someMethod())'", bindings.remove("execution(void org.jboss.test.aop.deployers.annotations.POJO->someMethod())"));
+
+ HashSet<String> definitions = new HashSet<String>();
+ definitions.addAll(newDefinitions.values());
+ assertTrue("Could not find 'org.jboss.test.aop.deployers.annotations.SomeInterceptor'", definitions.remove("org.jboss.test.aop.deployers.annotations.SomeInterceptor"));
+ assertTrue("Could not find 'org.jboss.test.aop.deployers.annotations.SomeAspect'", definitions.remove("org.jboss.test.aop.deployers.annotations.SomeAspect"));
+
+ getServer().invoke(DEPLOYER_MONITOR, "invokeAnnotationPOJO", new Object[0], new String[0]);
+ }
+ catch(Exception e)
+ {
+ throw e;
+ }
+ finally
+ {
+ undeploy("aop-deployertest-annotations.aop");
+ }
+
+ Map<String, String> finalBindings = (Map<String, String>)getServer().getAttribute(DEPLOYER_MONITOR, "CurrentBindings");
+ Map<String, String> finalAspectDefinitiona = (Map<String, String>)getServer().getAttribute(DEPLOYER_MONITOR, "CurrentAspectDefinitions");
+
+ compareSame(initialBindings, finalBindings);
+ compareSame(initialDefinitiona, finalAspectDefinitiona);
+ }
+
+ private static void compareSame(Map<String, String> initial, Map<String, String> end) throws Exception
+ {
+ assertEquals("Length was not same", initial.size(), end.size());
+
+ for (String key : end.keySet())
+ {
+ String initialValue = initial.get(key);
+ assertNotNull("Value for " + key + " was null", initialValue);
+ assertEquals("Values should be the same", initialValue, end.get(key));
+ }
+ }
+
+ private static Map<String, String> getInEndOnly(Map<String, String> initial, Map<String, String> end) throws Exception
+ {
+ HashMap<String, String> endOnly = new HashMap<String, String>();
+
+ for (String key : end.keySet())
+ {
+ if (initial.get(key) == null)
+ {
+ endOnly.put(key, end.get(key));
+ }
+ }
+
+ return endOnly;
+ }
+
+ public static Test suite() throws Exception
+ {
+ TestSuite suite = new TestSuite();
+ suite.addTest(new TestSuite(DeployersInitialTestCase.class));
+
+ AOPTestSetup setup = new AOPTestSetup(suite, "aop-deployertest.sar");
+ return setup;
+ }
+}
Modified: trunk/thirdparty/.project
===================================================================
--- trunk/thirdparty/.project 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/thirdparty/.project 2006-10-20 16:25:45 UTC (rev 57757)
@@ -1,9 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>thirdparty</name>
- <comment>Thirdparty jars</comment>
- <projects>
- </projects>
- <buildSpec>
- </buildSpec>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>thirdparty</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Modified: trunk/tools/etc/buildmagic/modules.ent
===================================================================
--- trunk/tools/etc/buildmagic/modules.ent 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/tools/etc/buildmagic/modules.ent 2006-10-20 16:25:45 UTC (rev 57757)
@@ -29,7 +29,7 @@
<property name="jboss.aspects.root" value="${project.root}/aspects/output"/>
<property name="jboss.aspects.lib" value="${jboss.aspects.root}/lib"/>
<path id="jboss.aspects.classpath">
- <pathelement path="${jboss.aspects.lib}/jboss-aspect-library.jar"/>
+ <pathelement path="${jboss.aspects.lib}/jboss-aspect-library-jdk50.jar"/>
</path>
<!-- tomcat -->
Modified: trunk/tools/etc/buildmagic/task.properties
===================================================================
--- trunk/tools/etc/buildmagic/task.properties 2006-10-20 12:22:14 UTC (rev 57756)
+++ trunk/tools/etc/buildmagic/task.properties 2006-10-20 16:25:45 UTC (rev 57757)
@@ -18,10 +18,10 @@
javac.debug=off
javac.optimize=on
javac.deprecation=on
-javac.target=1.4
+javac.target=1.5
javac.verbose=off
javac.depend=off
-javac.source=1.4
+javac.source=1.5
javac.include.ant.runtime=no
javac.include.java.runtime=no
More information about the jboss-cvs-commits
mailing list