[jboss-cvs] JBossAS SVN: r81044 - in trunk/aspects: src/etc and 5 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Nov 14 09:49:10 EST 2008
Author: dimitris at jboss.org
Date: 2008-11-14 09:49:09 -0500 (Fri, 14 Nov 2008)
New Revision: 81044
Modified:
trunk/aspects/build-original.xml
trunk/aspects/pom.xml
trunk/aspects/src/etc/META-INF/jboss-aspect-library-jboss-beans.xml
trunk/aspects/src/etc/ReadMe.txt
trunk/aspects/src/main/org/jboss/aop/asintegration/embedded/JBossEmbeddedUCLIntegration.java
trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/AOPAnnotationMetaDataParserDeployer.java
trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/AOPClassLoaderDeployer.java
trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/AOPDeploymentAopMetaDataDeployer.java
trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/AbstractAopMetaDataDeployer.java
trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/AliasesImpl.java
trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/AopMetaDataDeployerOutput.java
trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/BeansDeploymentAopMetaDataDeployer.java
trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/ClassLoaderDomainScope.java
trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/ClassLoaderDomainScopeFactory.java
trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/ClassLoaderDomainScopeImpl.java
trunk/aspects/src/main/org/jboss/aspects/library/JBossAspectLibrary.java
trunk/aspects/src/main/org/jboss/aspects/library/SecurityActions.java
trunk/aspects/src/main/org/jboss/aspects/remoting/DispatcherRegistration.java
Log:
fix svn properties
Modified: trunk/aspects/build-original.xml
===================================================================
--- trunk/aspects/build-original.xml 2008-11-14 14:46:22 UTC (rev 81043)
+++ trunk/aspects/build-original.xml 2008-11-14 14:49:09 UTC (rev 81044)
@@ -1,737 +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>
+<?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>
Property changes on: trunk/aspects/build-original.xml
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/aspects/pom.xml
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/aspects/src/etc/META-INF/jboss-aspect-library-jboss-beans.xml
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/aspects/src/etc/ReadMe.txt
===================================================================
--- trunk/aspects/src/etc/ReadMe.txt 2008-11-14 14:46:22 UTC (rev 81043)
+++ trunk/aspects/src/etc/ReadMe.txt 2008-11-14 14:49:09 UTC (rev 81044)
@@ -1,6 +1,6 @@
-* If installing in a version before JBoss 4.0.4, you should leave javassist.jar and common-softvaluehashmap.jar in place in this folder.
-
-*If installing in jboss 4.0.4 or later, the classes contained in javassist.jar and common-softvaluehashmap.jar will already be available,
-and you should do the following to avoid versioning conflicts:
--delete common-softvaluehashmap.jar
+* If installing in a version before JBoss 4.0.4, you should leave javassist.jar and common-softvaluehashmap.jar in place in this folder.
+
+*If installing in jboss 4.0.4 or later, the classes contained in javassist.jar and common-softvaluehashmap.jar will already be available,
+and you should do the following to avoid versioning conflicts:
+-delete common-softvaluehashmap.jar
-move javassist.jar to ../../lib/javassist.jar
\ No newline at end of file
Property changes on: trunk/aspects/src/etc/ReadMe.txt
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/aspects/src/main/org/jboss/aop/asintegration/embedded/JBossEmbeddedUCLIntegration.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aop/asintegration/embedded/JBossEmbeddedUCLIntegration.java 2008-11-14 14:46:22 UTC (rev 81043)
+++ trunk/aspects/src/main/org/jboss/aop/asintegration/embedded/JBossEmbeddedUCLIntegration.java 2008-11-14 14:49:09 UTC (rev 81044)
@@ -1,40 +1,40 @@
-/*
-* 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.aop.asintegration.embedded;
-
-import org.jboss.aop.asintegration.jboss4.JBoss4Integration;
-import org.jboss.mx.loading.RepositoryClassLoader;
-
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class JBossEmbeddedUCLIntegration extends JBoss4Integration
-{
- public boolean isValidClassLoader(ClassLoader loader)
- {
- //Accept all loaders as valid, and reject repository classloaders with null repository
- if (!(loader instanceof RepositoryClassLoader)) return true;
- return ((RepositoryClassLoader) loader).getLoaderRepository() != null;
- }
-}
+/*
+* 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.aop.asintegration.embedded;
+
+import org.jboss.aop.asintegration.jboss4.JBoss4Integration;
+import org.jboss.mx.loading.RepositoryClassLoader;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class JBossEmbeddedUCLIntegration extends JBoss4Integration
+{
+ public boolean isValidClassLoader(ClassLoader loader)
+ {
+ //Accept all loaders as valid, and reject repository classloaders with null repository
+ if (!(loader instanceof RepositoryClassLoader)) return true;
+ return ((RepositoryClassLoader) loader).getLoaderRepository() != null;
+ }
+}
Property changes on: trunk/aspects/src/main/org/jboss/aop/asintegration/embedded/JBossEmbeddedUCLIntegration.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/AOPAnnotationMetaDataParserDeployer.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/AOPAnnotationMetaDataParserDeployer.java 2008-11-14 14:46:22 UTC (rev 81043)
+++ trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/AOPAnnotationMetaDataParserDeployer.java 2008-11-14 14:49:09 UTC (rev 81044)
@@ -1,188 +1,188 @@
-/*
-* 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.aop.asintegration.jboss5;
-
-import java.io.BufferedInputStream;
-import java.io.DataInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-
-import javassist.bytecode.ClassFile;
-
-import org.jboss.aop.AspectAnnotationLoader;
-import org.jboss.aop.microcontainer.beans.metadata.AOPDeployment;
-import org.jboss.aop.microcontainer.beans.metadata.AspectManagerAwareBeanMetaDataFactory;
-import org.jboss.aop.microcontainer.beans.metadata.MicrocontainerAnnotationLoaderStrategy;
-import org.jboss.beans.metadata.spi.BeanMetaDataFactory;
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentStages;
-import org.jboss.deployers.spi.deployer.helpers.AbstractDeployer;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
-import org.jboss.virtual.VirtualFile;
-import org.jboss.virtual.VirtualFileFilter;
-import org.jboss.virtual.VisitorAttributes;
-import org.jboss.virtual.plugins.context.jar.JarUtils;
-import org.jboss.virtual.plugins.vfs.helpers.FilterVirtualFileVisitor;
-import org.jboss.virtual.plugins.vfs.helpers.SuffixesExcludeFilter;
-
-/**
- * Reads the annotations and converts them into AOP metadata to be deployed properly
- * by the AOPDeploymentAopMetaDataDeployer
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class AOPAnnotationMetaDataParserDeployer extends AbstractDeployer
-{
- public AOPAnnotationMetaDataParserDeployer(int xmlParserOrder)
- {
- super.setOutput(AOPDeployment.class);
- super.setStage(DeploymentStages.PARSE);
- //Make this come after the AOPXMLMetaDataParserDeployer
- super.setRelativeOrder(xmlParserOrder + 1);
- }
-
- public void deploy(DeploymentUnit unit) throws DeploymentException
- {
- // Ignore non-vfs deployments
- if (unit instanceof VFSDeploymentUnit == false)
- {
- log.trace("Not a vfs deployment: " + unit.getName());
- return;
- }
- // See if the suffix matches the .aop requirement
- if (unit.getSimpleName().endsWith(".aop") == false)
- {
- log.trace("Unit name does not end in .aop: " + unit.getSimpleName());
- return;
- }
- internalDeploy((VFSDeploymentUnit)unit);
- }
-
- private void internalDeploy(VFSDeploymentUnit unit) throws DeploymentException
- {
- MicrocontainerAnnotationLoaderStrategy strategy = new MicrocontainerAnnotationLoaderStrategy();
- AspectAnnotationLoader loader = new AspectAnnotationLoader(null, strategy);
-
- List<VirtualFile> files = getClasses(unit);
- for(VirtualFile file : files)
- {
- try
- {
- ClassFile cf = loadClassFile(file);
- log.debug("Deploying possibly annotated class " + cf.getName());
- loader.deployClassFile(cf);
- }
- catch (Exception e)
- {
- throw new DeploymentException("Error reading annotations for " + file, e);
- }
- }
-
- List<AspectManagerAwareBeanMetaDataFactory> factories = strategy.getFactories();
-
- AOPDeployment deployment = unit.getAttachment(AOPDeployment.class);
- if (factories != null && factories.size() > 0)
- {
- if (deployment == null)
- {
- deployment = new AOPDeployment();
- unit.addAttachment(AOPDeployment.class.getName(), deployment, AOPDeployment.class);
- }
- if (deployment.getBeanFactories() == null)
- {
- deployment.setBeanFactories(new ArrayList<BeanMetaDataFactory>());
- }
- deployment.getBeanFactories().addAll(factories);
- }
- }
-
- private ClassFile loadClassFile(VirtualFile file)
- {
- DataInputStream din = null;
- ClassFile cf = null;
- try
- {
- InputStream in = file.openStream();
- din = new DataInputStream(new BufferedInputStream(in));
- cf = new ClassFile(din);
- }
- catch (IOException e)
- {
- throw new RuntimeException("Error reading " + file, e);
- }
- finally
- {
- try
- {
- din.close();
- }
- catch (IOException ignored)
- {
- }
- }
-
- return cf;
- }
-
- private List<VirtualFile> getClasses(VFSDeploymentUnit unit)
- {
- VisitorAttributes va = new VisitorAttributes();
- va.setLeavesOnly(true);
- ClassFileFilter filter = new ClassFileFilter();
- SuffixesExcludeFilter noJars = new SuffixesExcludeFilter(JarUtils.getSuffixes());
- va.setRecurseFilter(noJars);
- FilterVirtualFileVisitor visitor = new FilterVirtualFileVisitor(filter, va);
-
- for (VirtualFile vf : unit.getClassPath())
- {
- try
- {
- vf.visit(visitor);
- }
- catch (IOException e)
- {
- throw new RuntimeException(e);
- }
- }
- return visitor.getMatched();
-
- }
-
- private static class ClassFileFilter implements VirtualFileFilter
- {
- public boolean accepts(VirtualFile file)
- {
- try
- {
- return file.isLeaf() && file.getName().endsWith(".class");
- }
- catch (IOException e)
- {
- throw new RuntimeException("Error visiting file: " + file.getName(), e);
- }
- }
- }
-}
+/*
+* 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.aop.asintegration.jboss5;
+
+import java.io.BufferedInputStream;
+import java.io.DataInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import javassist.bytecode.ClassFile;
+
+import org.jboss.aop.AspectAnnotationLoader;
+import org.jboss.aop.microcontainer.beans.metadata.AOPDeployment;
+import org.jboss.aop.microcontainer.beans.metadata.AspectManagerAwareBeanMetaDataFactory;
+import org.jboss.aop.microcontainer.beans.metadata.MicrocontainerAnnotationLoaderStrategy;
+import org.jboss.beans.metadata.spi.BeanMetaDataFactory;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentStages;
+import org.jboss.deployers.spi.deployer.helpers.AbstractDeployer;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.virtual.VirtualFile;
+import org.jboss.virtual.VirtualFileFilter;
+import org.jboss.virtual.VisitorAttributes;
+import org.jboss.virtual.plugins.context.jar.JarUtils;
+import org.jboss.virtual.plugins.vfs.helpers.FilterVirtualFileVisitor;
+import org.jboss.virtual.plugins.vfs.helpers.SuffixesExcludeFilter;
+
+/**
+ * Reads the annotations and converts them into AOP metadata to be deployed properly
+ * by the AOPDeploymentAopMetaDataDeployer
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class AOPAnnotationMetaDataParserDeployer extends AbstractDeployer
+{
+ public AOPAnnotationMetaDataParserDeployer(int xmlParserOrder)
+ {
+ super.setOutput(AOPDeployment.class);
+ super.setStage(DeploymentStages.PARSE);
+ //Make this come after the AOPXMLMetaDataParserDeployer
+ super.setRelativeOrder(xmlParserOrder + 1);
+ }
+
+ public void deploy(DeploymentUnit unit) throws DeploymentException
+ {
+ // Ignore non-vfs deployments
+ if (unit instanceof VFSDeploymentUnit == false)
+ {
+ log.trace("Not a vfs deployment: " + unit.getName());
+ return;
+ }
+ // See if the suffix matches the .aop requirement
+ if (unit.getSimpleName().endsWith(".aop") == false)
+ {
+ log.trace("Unit name does not end in .aop: " + unit.getSimpleName());
+ return;
+ }
+ internalDeploy((VFSDeploymentUnit)unit);
+ }
+
+ private void internalDeploy(VFSDeploymentUnit unit) throws DeploymentException
+ {
+ MicrocontainerAnnotationLoaderStrategy strategy = new MicrocontainerAnnotationLoaderStrategy();
+ AspectAnnotationLoader loader = new AspectAnnotationLoader(null, strategy);
+
+ List<VirtualFile> files = getClasses(unit);
+ for(VirtualFile file : files)
+ {
+ try
+ {
+ ClassFile cf = loadClassFile(file);
+ log.debug("Deploying possibly annotated class " + cf.getName());
+ loader.deployClassFile(cf);
+ }
+ catch (Exception e)
+ {
+ throw new DeploymentException("Error reading annotations for " + file, e);
+ }
+ }
+
+ List<AspectManagerAwareBeanMetaDataFactory> factories = strategy.getFactories();
+
+ AOPDeployment deployment = unit.getAttachment(AOPDeployment.class);
+ if (factories != null && factories.size() > 0)
+ {
+ if (deployment == null)
+ {
+ deployment = new AOPDeployment();
+ unit.addAttachment(AOPDeployment.class.getName(), deployment, AOPDeployment.class);
+ }
+ if (deployment.getBeanFactories() == null)
+ {
+ deployment.setBeanFactories(new ArrayList<BeanMetaDataFactory>());
+ }
+ deployment.getBeanFactories().addAll(factories);
+ }
+ }
+
+ private ClassFile loadClassFile(VirtualFile file)
+ {
+ DataInputStream din = null;
+ ClassFile cf = null;
+ try
+ {
+ InputStream in = file.openStream();
+ din = new DataInputStream(new BufferedInputStream(in));
+ cf = new ClassFile(din);
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException("Error reading " + file, e);
+ }
+ finally
+ {
+ try
+ {
+ din.close();
+ }
+ catch (IOException ignored)
+ {
+ }
+ }
+
+ return cf;
+ }
+
+ private List<VirtualFile> getClasses(VFSDeploymentUnit unit)
+ {
+ VisitorAttributes va = new VisitorAttributes();
+ va.setLeavesOnly(true);
+ ClassFileFilter filter = new ClassFileFilter();
+ SuffixesExcludeFilter noJars = new SuffixesExcludeFilter(JarUtils.getSuffixes());
+ va.setRecurseFilter(noJars);
+ FilterVirtualFileVisitor visitor = new FilterVirtualFileVisitor(filter, va);
+
+ for (VirtualFile vf : unit.getClassPath())
+ {
+ try
+ {
+ vf.visit(visitor);
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+ return visitor.getMatched();
+
+ }
+
+ private static class ClassFileFilter implements VirtualFileFilter
+ {
+ public boolean accepts(VirtualFile file)
+ {
+ try
+ {
+ return file.isLeaf() && file.getName().endsWith(".class");
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException("Error visiting file: " + file.getName(), e);
+ }
+ }
+ }
+}
Property changes on: trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/AOPAnnotationMetaDataParserDeployer.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/AOPClassLoaderDeployer.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/AOPClassLoaderDeployer.java 2008-11-14 14:46:22 UTC (rev 81043)
+++ trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/AOPClassLoaderDeployer.java 2008-11-14 14:49:09 UTC (rev 81044)
@@ -1,82 +1,82 @@
-/*
-* 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.aop.asintegration.jboss5;
-
-import org.jboss.aop.AspectManager;
-import org.jboss.aop.Domain;
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentStages;
-import org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class AOPClassLoaderDeployer extends AbstractRealDeployer
-{
- AspectManager aspectManager;
-
- public AOPClassLoaderDeployer()
- {
- setStage(DeploymentStages.CLASSLOADER);
-
- //This makes it come after the ClassLoaderDeployer
- addInput(ClassLoader.class);
- }
-
- public AspectManager getAspectManager()
- {
- return aspectManager;
- }
-
- public void setAspectManager(AspectManager aspectManager)
- {
- this.aspectManager = aspectManager;
- }
-
- @Override
- protected void internalDeploy(DeploymentUnit unit) throws DeploymentException
- {
- //Scoped AOP deployments are only available when deployed as part of a scoped sar, ear etc.
- //It can contain an aop.xml file, or it can be part of a .aop file
-
- AspectManager manager = aspectManager;
- Domain domain = AOPClassLoaderInitializer.initializeForUnit(unit);
- if (domain != null)
- {
- manager = domain;
- }
- log.debug("Adding AspectManager attachment " + manager + " for " + unit);
- unit.addAttachment(AspectManager.class, manager);
- }
-
- @Override
- public void internalUndeploy(DeploymentUnit unit)
- {
- AOPClassLoaderInitializer.unregisterLoaders(aspectManager, unit);
- }
-
-
-
-}
+/*
+* 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.aop.asintegration.jboss5;
+
+import org.jboss.aop.AspectManager;
+import org.jboss.aop.Domain;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentStages;
+import org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class AOPClassLoaderDeployer extends AbstractRealDeployer
+{
+ AspectManager aspectManager;
+
+ public AOPClassLoaderDeployer()
+ {
+ setStage(DeploymentStages.CLASSLOADER);
+
+ //This makes it come after the ClassLoaderDeployer
+ addInput(ClassLoader.class);
+ }
+
+ public AspectManager getAspectManager()
+ {
+ return aspectManager;
+ }
+
+ public void setAspectManager(AspectManager aspectManager)
+ {
+ this.aspectManager = aspectManager;
+ }
+
+ @Override
+ protected void internalDeploy(DeploymentUnit unit) throws DeploymentException
+ {
+ //Scoped AOP deployments are only available when deployed as part of a scoped sar, ear etc.
+ //It can contain an aop.xml file, or it can be part of a .aop file
+
+ AspectManager manager = aspectManager;
+ Domain domain = AOPClassLoaderInitializer.initializeForUnit(unit);
+ if (domain != null)
+ {
+ manager = domain;
+ }
+ log.debug("Adding AspectManager attachment " + manager + " for " + unit);
+ unit.addAttachment(AspectManager.class, manager);
+ }
+
+ @Override
+ public void internalUndeploy(DeploymentUnit unit)
+ {
+ AOPClassLoaderInitializer.unregisterLoaders(aspectManager, unit);
+ }
+
+
+
+}
Property changes on: trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/AOPClassLoaderDeployer.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/AOPDeploymentAopMetaDataDeployer.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/AOPDeploymentAopMetaDataDeployer.java 2008-11-14 14:46:22 UTC (rev 81043)
+++ trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/AOPDeploymentAopMetaDataDeployer.java 2008-11-14 14:49:09 UTC (rev 81044)
@@ -1,61 +1,61 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, Red Hat Middleware LLC., 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.asintegration.jboss5;
-
-import java.util.List;
-
-import org.jboss.aop.microcontainer.beans.metadata.AOPDeployment;
-import org.jboss.beans.metadata.spi.BeanMetaDataFactory;
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
-
-/**
- * Deployer for Aspects in a -aop.xml or .aop
- *
- * @author <a href="mailto:kabir.khan at jboss.org">Kabir Khan</a>
- */
-public class AOPDeploymentAopMetaDataDeployer extends AbstractAopMetaDataDeployer<AOPDeployment>
-{
- public AOPDeploymentAopMetaDataDeployer()
- {
- super(AOPDeployment.class);
- }
-
- @Override
- public void deploy(VFSDeploymentUnit unit, AOPDeployment aopDeployment) throws DeploymentException
- {
- super.deploy(unit, aopDeployment);
- }
-
- @Override
- public void undeploy(VFSDeploymentUnit unit, AOPDeployment aopDeployment)
- {
- super.undeploy(unit, aopDeployment);
- }
-
-
- @Override
- protected List<BeanMetaDataFactory> getFactories(AOPDeployment deployment)
- {
- return deployment.getBeanFactories();
- }
-}
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, Red Hat Middleware LLC., 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.asintegration.jboss5;
+
+import java.util.List;
+
+import org.jboss.aop.microcontainer.beans.metadata.AOPDeployment;
+import org.jboss.beans.metadata.spi.BeanMetaDataFactory;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+
+/**
+ * Deployer for Aspects in a -aop.xml or .aop
+ *
+ * @author <a href="mailto:kabir.khan at jboss.org">Kabir Khan</a>
+ */
+public class AOPDeploymentAopMetaDataDeployer extends AbstractAopMetaDataDeployer<AOPDeployment>
+{
+ public AOPDeploymentAopMetaDataDeployer()
+ {
+ super(AOPDeployment.class);
+ }
+
+ @Override
+ public void deploy(VFSDeploymentUnit unit, AOPDeployment aopDeployment) throws DeploymentException
+ {
+ super.deploy(unit, aopDeployment);
+ }
+
+ @Override
+ public void undeploy(VFSDeploymentUnit unit, AOPDeployment aopDeployment)
+ {
+ super.undeploy(unit, aopDeployment);
+ }
+
+
+ @Override
+ protected List<BeanMetaDataFactory> getFactories(AOPDeployment deployment)
+ {
+ return deployment.getBeanFactories();
+ }
+}
Property changes on: trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/AOPDeploymentAopMetaDataDeployer.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/AbstractAopMetaDataDeployer.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/AbstractAopMetaDataDeployer.java 2008-11-14 14:46:22 UTC (rev 81043)
+++ trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/AbstractAopMetaDataDeployer.java 2008-11-14 14:49:09 UTC (rev 81044)
@@ -1,554 +1,554 @@
-/*
-* 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.aop.asintegration.jboss5;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import org.jboss.aop.AspectManager;
-import org.jboss.aop.microcontainer.beans.metadata.AspectManagerAwareBeanMetaDataFactory;
-import org.jboss.beans.metadata.plugins.AbstractClassLoaderMetaData;
-import org.jboss.beans.metadata.plugins.AbstractValueMetaData;
-import org.jboss.beans.metadata.spi.BeanMetaData;
-import org.jboss.beans.metadata.spi.BeanMetaDataFactory;
-import org.jboss.beans.metadata.spi.ClassLoaderMetaData;
-import org.jboss.beans.metadata.spi.ValueMetaData;
-import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
-import org.jboss.classloader.spi.ClassLoaderSystem;
-import org.jboss.classloading.spi.dependency.Module;
-import org.jboss.dependency.spi.ScopeInfo;
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentStages;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.deployers.vfs.spi.deployer.AbstractSimpleVFSRealDeployer;
-import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
-import org.jboss.kernel.Kernel;
-import org.jboss.kernel.plugins.dependency.AbstractKernelControllerContext;
-import org.jboss.kernel.spi.dependency.KernelController;
-import org.jboss.kernel.spi.dependency.KernelControllerContext;
-import org.jboss.metadata.spi.repository.MutableMetaDataRepository;
-import org.jboss.metadata.spi.scope.CommonLevels;
-import org.jboss.metadata.spi.scope.Scope;
-import org.jboss.metadata.spi.scope.ScopeKey;
-
-/**
- * Deployer for deployments containing AOP metadata. It makes sure that the metadata is deployed to the
- * right aop domain in the case of scoped classloaders. The AOP metadata is stripped out of the deployment
- * to avoid deploying it twice.
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public abstract class AbstractAopMetaDataDeployer<T> extends AbstractSimpleVFSRealDeployer<T>
-{
- private AspectManager aspectManager;
- private KernelController controller;
- private MyBeanMetaDataDeployer beanMetaDataDeployer = new MyBeanMetaDataDeployer();
- private static int sequence;
-
-
- public AbstractAopMetaDataDeployer(Class<T> input)
- {
- super(input);
- super.setStage(DeploymentStages.POST_CLASSLOADER);
- super.setOutput(AopMetaDataDeployerOutput.class);
- }
-
- /**
- * Get the aspectManager.
- *
- * @return the aspectManager.
- */
- public AspectManager getAspectManager()
- {
- return aspectManager;
- }
-
- /**
- * Set the aspectManager.
- *
- * @param aspectManager the aspectManager.
- */
- public void setAspectManager(AspectManager aspectManager)
- {
- this.aspectManager = aspectManager;
- }
-
- /**
- * Set the kernel.
- *
- * @param kernel the kernel
- */
- public void setKernel(Kernel kernel)
- {
- this.controller = kernel.getController();
- }
-
- /**
- * Method for subclasses to call upon deployment
- */
- @Override
- public void deploy(VFSDeploymentUnit unit, T deployment) throws DeploymentException
- {
- log.debug("Deploying " + unit + " " + deployment);
-
- AopMetaDataDeployerOutput output = new AopMetaDataDeployerOutput();
- unit.addAttachment(AopMetaDataDeployerOutput.class, output);
-
- if (extractAopBeanMetaDataFactories(unit, deployment, output))
- {
- AspectManager correctManager = unit.getAttachment(AspectManager.class);
- log.debug("Got AspectManager attachment " + correctManager + " for " + unit);
- if (correctManager != aspectManager)
- {
- int sequence = getSequence();
- String scopedManagerName = registerScopedManagerBean(sequence, unit, correctManager, output);
- massageScopedDeployment(sequence, unit, deployment, output, scopedManagerName);
- }
- }
-
- try
- {
- deployBeans(unit, output);
- }
- catch (Throwable t)
- {
- unregisterScopedManagerBean(output.getScopedAspectManagerBeanName(), false);
- if (t instanceof DeploymentException)
- {
- throw (DeploymentException)t;
- }
- else
- {
- throw new DeploymentException(t);
- }
- }
- log.debug("Finished deploying " + unit);
- }
-
-
- /**
- * Method for subclasses to call upon undeployment
- */
- @Override
- public void undeploy(VFSDeploymentUnit unit, T deployment)
- {
- log.debug("Undeploying " + unit + " " + deployment);
-
- AopMetaDataDeployerOutput output = unit.getAttachment(AopMetaDataDeployerOutput.class);
-
- undeployBeans(unit, output);
- }
-
- protected abstract List<BeanMetaDataFactory> getFactories(T deployment);
-
- private boolean extractAopBeanMetaDataFactories(VFSDeploymentUnit unit, T deployment, AopMetaDataDeployerOutput output)
- {
- log.debug("Extracting aop bean metadata factories for " + unit);
- List<AspectManagerAwareBeanMetaDataFactory> aopFactories = new ArrayList<AspectManagerAwareBeanMetaDataFactory>();
-
- List<BeanMetaDataFactory> factories = getFactories(deployment);
- if (factories != null && factories.size() > 0)
- {
- for (Iterator<BeanMetaDataFactory> it = factories.iterator() ; it.hasNext() ; )
- {
- BeanMetaDataFactory factory = it.next();
- if (factory instanceof AspectManagerAwareBeanMetaDataFactory)
- {
- it.remove();
- aopFactories.add((AspectManagerAwareBeanMetaDataFactory)factory);
- }
- }
- }
-
- if (aopFactories.size() > 0)
- {
- output.setFactories(aopFactories);
- return true;
- }
- return false;
- }
-
- private String registerScopedManagerBean(int sequence, VFSDeploymentUnit unit, AspectManager scopedManager, AopMetaDataDeployerOutput output) throws DeploymentException
- {
- String name = "ScopedManager_" + getSequence() + "_" + unit.getName();
- BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder(name, scopedManager.getClass().getName());
- unit.getMutableMetaData().addMetaData(scopedManager, AspectManager.class);
-
- try
- {
- controller.install(builder.getBeanMetaData(), scopedManager);
- return name;
- }
- catch (Throwable e)
- {
- throw new DeploymentException("Error registering scoped manager" + name + " " + scopedManager, e);
- }
- }
-
- private synchronized int getSequence()
- {
- return ++sequence;
- }
-
- private void unregisterScopedManagerBean(String name, boolean logError)
- {
- if (name == null)
- {
- return;
- }
-
- try
- {
- controller.uninstall(name);
- }
- catch(Throwable t)
- {
- if (logError)
- {
- log.debug("Error unregistering scoped aspect manager " + name, t);
- }
- }
- }
-
- private void massageScopedDeployment(int sequence, VFSDeploymentUnit unit, T deployment, AopMetaDataDeployerOutput output, String scopedManagerName) throws DeploymentException
- {
- log.debug("Massaging scoped deployment " + unit + " setting manager to " + scopedManagerName);
- String domainName = getDomainName(unit);
- output.setScopedInformation(scopedManagerName, domainName, sequence);
- unit.getMutableMetaData().addAnnotation(output.getScopeAnnotation());
- }
-
- private String getDomainName(VFSDeploymentUnit unit)
- {
- Module module = unit.getTopLevel().getAttachment(Module.class);
- if (module != null && !module.getDeterminedDomainName().equals(ClassLoaderSystem.DEFAULT_DOMAIN_NAME))
- {
- return module.getDeterminedDomainName();
- }
-
- return null;
- }
-
- private void deployBeans(VFSDeploymentUnit unit, AopMetaDataDeployerOutput output) throws DeploymentException
- {
- List<BeanMetaData> aopBeans = output.getBeans();
- List<BeanMetaData> done = new ArrayList<BeanMetaData>();
- try
- {
- if (aopBeans != null && aopBeans.size() > 0)
- {
- for (BeanMetaData bean : aopBeans)
- {
- //Register the component deployment context so we get the correct mutable metadata scope
- //This has been replaced by a "fake" implementation to avoid the overhead of the real one
- //which registers everything in JMX, which is pointless since we throw it away immediately
- FakeComponentUnit componentUnit = deployComponentDeploymentContext(unit, bean);
- try
- {
- beanMetaDataDeployer.deploy(componentUnit, bean);
- done.add(bean);
- }
- finally
- {
- //Unregister the component deployment context so that this bean does not get deployed
- //again by the real BeanMetaDataDeployer
- undeployComponentDeploymentContext(componentUnit, bean);
- }
- }
- }
- }
- catch (Throwable t)
- {
- for (int i = done.size() - 1 ; i >= 0 ; i--)
- {
- try
- {
- beanMetaDataDeployer.undeploy(unit, done.get(i));
- controller.uninstall(done.get(i));
- }
- catch (Throwable e)
- {
- log.debug("Error undeploying " + done.get(i) + " for " + unit);
- }
- }
- throw new DeploymentException(t);
- }
- }
-
- private void undeployBeans(VFSDeploymentUnit unit, AopMetaDataDeployerOutput output)
- {
- if (output != null)
- {
- List<BeanMetaData> aopBeans = output.getBeans();
- if (aopBeans != null && aopBeans.size() > 0)
- {
- for (int i = aopBeans.size() - 1 ; i >= 0 ; i--)
- {
- BeanMetaData bean = aopBeans.get(i);
- beanMetaDataDeployer.undeploy(unit, bean);
- }
- }
- }
- }
-
- /**
- * Wrap the deployment unit in a component deployment unit similar to what the KernelDeploymentDeployer does
- */
- private FakeComponentUnit deployComponentDeploymentContext(VFSDeploymentUnit unit, BeanMetaData deployment)
- {
- //This used to make the following calls which has the overhead of registering the unit in JMX.
- //All we really want are the scopes, which is handled by FakeComponentUnit
-// DeploymentUnit componentUnit = unit.addComponent(deployment.getName());
-// componentUnit.addAttachment(BeanMetaData.class.getName(), deployment);
-// return componentUnit;
- return new FakeComponentUnit(unit, deployment);
- }
-
- /**
- * Undeploy the component deployment unit similar to what the KernelDeploymentDeployer does
- */
- private void undeployComponentDeploymentContext(FakeComponentUnit unit, BeanMetaData bean)
- {
- unit.cleanup();
- }
-
- private class MyBeanMetaDataDeployer
- {
- /**
- * Copied from the real org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer
- */
- private void deploy(FakeComponentUnit unit, BeanMetaData deployment) throws DeploymentException
- {
- // No explicit classloader, use the deployment's classloader
- if (deployment.getClassLoader() == null)
- {
- try
- {
- // Check the unit has a classloader
- unit.getClassLoader();
- // TODO clone the metadata?
- deployment.setClassLoader(new DeploymentClassLoaderMetaData(unit));
- }
- catch (Exception e)
- {
- log.debug("Unable to retrieve classloader for deployment: " + unit.getName() + " reason=" + e.toString());
- }
- }
- KernelControllerContext context = new AbstractKernelControllerContext(null, deployment, null);
- //Make sure that the metadata from the deployment gets put into the context
- ScopeInfo scopeInfo = context.getScopeInfo();
- if (scopeInfo != null)
- {
- mergeScopes(scopeInfo.getScope(), unit.getScope());
- mergeScopes(scopeInfo.getMutableScope(), unit.getMutableScope());
- }
-
-// KernelControllerContext context = new AbstractKernelControllerContext(null, deployment, null);
-// ScopeInfo scopeInfo2 = context.getScopeInfo();
-// if (scopeInfo2 != null)
-// {
-// ScopeKey key = unit.getScope().clone();
-// key.removeScopeLevel(CommonLevels.INSTANCE);
-// key.addScope(CommonLevels.INSTANCE, deployment.getName());
-//
-// ScopeKey mutable = new ScopeKey();
-// key.addScope(CommonLevels.INSTANCE, deployment.getName());
-//
-// mergeScopes(scopeInfo2.getScope(), key);
-// mergeScopes(scopeInfo2.getMutableScope(), mutable);
-// }
-
- try
- {
- //System.out.println("==============> Installing " + context.getName());
- controller.install(context);
- }
- catch (Throwable t)
- {
- throw DeploymentException.rethrowAsDeploymentException("Error deploying: " + deployment.getName(), t);
- }
-
-
- }
-
- /**
- * Copied from the real org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer
- * Merge scope keys.
- *
- * @param contextKey the context key
- * @param unitKey the unit key
- */
- protected void mergeScopes(ScopeKey contextKey, ScopeKey unitKey)
- {
- if (contextKey == null)
- return;
- if (unitKey == null)
- return;
-
- Collection<Scope> unitScopes = unitKey.getScopes();
- if (unitScopes == null || unitScopes.isEmpty())
- return;
-
- for (Scope scope : unitScopes)
- contextKey.addScope(scope);
- }
-
- /**
- * Copied from the real org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer
- */
- private void undeploy(DeploymentUnit unit, BeanMetaData deployment)
- {
- try
- {
- controller.uninstall(deployment.getName());
-
- // Remove any classloader metadata we added (not necessary if we clone above)
- ClassLoaderMetaData classLoader = deployment.getClassLoader();
- if (classLoader instanceof DeploymentClassLoaderMetaData)
- deployment.setClassLoader(null);
- }
- catch(Throwable t)
- {
- log.info("Error undeploying " + deployment + " for " + unit);
- }
- }
- }
-
- /**
- * Copied from BeanMetaDataDeployer
- */
- private static class DeploymentClassLoaderMetaData extends AbstractClassLoaderMetaData
- {
- /** The serialVersionUID */
- private static final long serialVersionUID = 1L;
-
- /** The deployment unit */
- private FakeComponentUnit unit;
-
- /**
- * Create a new DeploymentClassLoaderMetaData.
- *
- * @param unit the deployment unit
- */
- public DeploymentClassLoaderMetaData(FakeComponentUnit unit)
- {
- if (unit == null)
- throw new IllegalArgumentException("Null unit");
- this.unit = unit;
- }
-
- @Override
- public ValueMetaData getClassLoader()
- {
- return new AbstractValueMetaData(unit.getClassLoader());
- }
- }
-
- /**
- * BeanMetaDatadeployer uses AbstractComponentUnit per bean, but that has the overhead of
- * registering things in JMX. Create a Fake one here to encapsulate the methods that we use
- * without registering things in JMX
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
- private static class FakeComponentUnit
- {
- VFSDeploymentUnit parent;
- BeanMetaData bmd;
- ScopeKey scope;
- ScopeKey mutableScope;
-
- FakeComponentUnit(VFSDeploymentUnit parent, BeanMetaData bmd)
- {
- this.parent = parent;
- this.bmd = bmd;
- }
-
- ScopeKey getScope()
- {
- if (scope == null)
- {
- ScopeKey key = parent.getScope().clone();
- key.removeScopeLevel(CommonLevels.INSTANCE);
- key.addScope(CommonLevels.INSTANCE, bmd.getName());
- }
- return scope;
- }
-
- ScopeKey getMutableScope()
- {
- if (mutableScope == null)
- {
- mutableScope = new ScopeKey();
- mutableScope.addScope(CommonLevels.INSTANCE, bmd.getName());
- }
- return mutableScope;
- }
-
- ClassLoader getClassLoader()
- {
- return parent.getClassLoader();
- }
-
- String getName()
- {
- return bmd.getName();
- }
-
- void cleanup()
- {
- MutableMetaDataRepository repository = null;
- DeploymentUnit unit = parent;
- while (repository == null && unit != null)
- {
- repository = unit.getAttachment(MutableMetaDataRepository.class);
- unit = parent.getParent();
- }
- if (repository == null)
- {
- return;
- }
-
- try
- {
- ScopeKey scope = getScope();
- repository.removeMetaDataRetrieval(scope);
- }
- catch (Throwable ignored)
- {
- }
-
- try
- {
- ScopeKey scope = getMutableScope();
- repository.removeMetaDataRetrieval(scope);
- }
- catch (Throwable ignored)
- {
- }
- }
- }
-}
+/*
+* 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.aop.asintegration.jboss5;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import org.jboss.aop.AspectManager;
+import org.jboss.aop.microcontainer.beans.metadata.AspectManagerAwareBeanMetaDataFactory;
+import org.jboss.beans.metadata.plugins.AbstractClassLoaderMetaData;
+import org.jboss.beans.metadata.plugins.AbstractValueMetaData;
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.beans.metadata.spi.BeanMetaDataFactory;
+import org.jboss.beans.metadata.spi.ClassLoaderMetaData;
+import org.jboss.beans.metadata.spi.ValueMetaData;
+import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
+import org.jboss.classloader.spi.ClassLoaderSystem;
+import org.jboss.classloading.spi.dependency.Module;
+import org.jboss.dependency.spi.ScopeInfo;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentStages;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.vfs.spi.deployer.AbstractSimpleVFSRealDeployer;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.plugins.dependency.AbstractKernelControllerContext;
+import org.jboss.kernel.spi.dependency.KernelController;
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
+import org.jboss.metadata.spi.repository.MutableMetaDataRepository;
+import org.jboss.metadata.spi.scope.CommonLevels;
+import org.jboss.metadata.spi.scope.Scope;
+import org.jboss.metadata.spi.scope.ScopeKey;
+
+/**
+ * Deployer for deployments containing AOP metadata. It makes sure that the metadata is deployed to the
+ * right aop domain in the case of scoped classloaders. The AOP metadata is stripped out of the deployment
+ * to avoid deploying it twice.
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class AbstractAopMetaDataDeployer<T> extends AbstractSimpleVFSRealDeployer<T>
+{
+ private AspectManager aspectManager;
+ private KernelController controller;
+ private MyBeanMetaDataDeployer beanMetaDataDeployer = new MyBeanMetaDataDeployer();
+ private static int sequence;
+
+
+ public AbstractAopMetaDataDeployer(Class<T> input)
+ {
+ super(input);
+ super.setStage(DeploymentStages.POST_CLASSLOADER);
+ super.setOutput(AopMetaDataDeployerOutput.class);
+ }
+
+ /**
+ * Get the aspectManager.
+ *
+ * @return the aspectManager.
+ */
+ public AspectManager getAspectManager()
+ {
+ return aspectManager;
+ }
+
+ /**
+ * Set the aspectManager.
+ *
+ * @param aspectManager the aspectManager.
+ */
+ public void setAspectManager(AspectManager aspectManager)
+ {
+ this.aspectManager = aspectManager;
+ }
+
+ /**
+ * Set the kernel.
+ *
+ * @param kernel the kernel
+ */
+ public void setKernel(Kernel kernel)
+ {
+ this.controller = kernel.getController();
+ }
+
+ /**
+ * Method for subclasses to call upon deployment
+ */
+ @Override
+ public void deploy(VFSDeploymentUnit unit, T deployment) throws DeploymentException
+ {
+ log.debug("Deploying " + unit + " " + deployment);
+
+ AopMetaDataDeployerOutput output = new AopMetaDataDeployerOutput();
+ unit.addAttachment(AopMetaDataDeployerOutput.class, output);
+
+ if (extractAopBeanMetaDataFactories(unit, deployment, output))
+ {
+ AspectManager correctManager = unit.getAttachment(AspectManager.class);
+ log.debug("Got AspectManager attachment " + correctManager + " for " + unit);
+ if (correctManager != aspectManager)
+ {
+ int sequence = getSequence();
+ String scopedManagerName = registerScopedManagerBean(sequence, unit, correctManager, output);
+ massageScopedDeployment(sequence, unit, deployment, output, scopedManagerName);
+ }
+ }
+
+ try
+ {
+ deployBeans(unit, output);
+ }
+ catch (Throwable t)
+ {
+ unregisterScopedManagerBean(output.getScopedAspectManagerBeanName(), false);
+ if (t instanceof DeploymentException)
+ {
+ throw (DeploymentException)t;
+ }
+ else
+ {
+ throw new DeploymentException(t);
+ }
+ }
+ log.debug("Finished deploying " + unit);
+ }
+
+
+ /**
+ * Method for subclasses to call upon undeployment
+ */
+ @Override
+ public void undeploy(VFSDeploymentUnit unit, T deployment)
+ {
+ log.debug("Undeploying " + unit + " " + deployment);
+
+ AopMetaDataDeployerOutput output = unit.getAttachment(AopMetaDataDeployerOutput.class);
+
+ undeployBeans(unit, output);
+ }
+
+ protected abstract List<BeanMetaDataFactory> getFactories(T deployment);
+
+ private boolean extractAopBeanMetaDataFactories(VFSDeploymentUnit unit, T deployment, AopMetaDataDeployerOutput output)
+ {
+ log.debug("Extracting aop bean metadata factories for " + unit);
+ List<AspectManagerAwareBeanMetaDataFactory> aopFactories = new ArrayList<AspectManagerAwareBeanMetaDataFactory>();
+
+ List<BeanMetaDataFactory> factories = getFactories(deployment);
+ if (factories != null && factories.size() > 0)
+ {
+ for (Iterator<BeanMetaDataFactory> it = factories.iterator() ; it.hasNext() ; )
+ {
+ BeanMetaDataFactory factory = it.next();
+ if (factory instanceof AspectManagerAwareBeanMetaDataFactory)
+ {
+ it.remove();
+ aopFactories.add((AspectManagerAwareBeanMetaDataFactory)factory);
+ }
+ }
+ }
+
+ if (aopFactories.size() > 0)
+ {
+ output.setFactories(aopFactories);
+ return true;
+ }
+ return false;
+ }
+
+ private String registerScopedManagerBean(int sequence, VFSDeploymentUnit unit, AspectManager scopedManager, AopMetaDataDeployerOutput output) throws DeploymentException
+ {
+ String name = "ScopedManager_" + getSequence() + "_" + unit.getName();
+ BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder(name, scopedManager.getClass().getName());
+ unit.getMutableMetaData().addMetaData(scopedManager, AspectManager.class);
+
+ try
+ {
+ controller.install(builder.getBeanMetaData(), scopedManager);
+ return name;
+ }
+ catch (Throwable e)
+ {
+ throw new DeploymentException("Error registering scoped manager" + name + " " + scopedManager, e);
+ }
+ }
+
+ private synchronized int getSequence()
+ {
+ return ++sequence;
+ }
+
+ private void unregisterScopedManagerBean(String name, boolean logError)
+ {
+ if (name == null)
+ {
+ return;
+ }
+
+ try
+ {
+ controller.uninstall(name);
+ }
+ catch(Throwable t)
+ {
+ if (logError)
+ {
+ log.debug("Error unregistering scoped aspect manager " + name, t);
+ }
+ }
+ }
+
+ private void massageScopedDeployment(int sequence, VFSDeploymentUnit unit, T deployment, AopMetaDataDeployerOutput output, String scopedManagerName) throws DeploymentException
+ {
+ log.debug("Massaging scoped deployment " + unit + " setting manager to " + scopedManagerName);
+ String domainName = getDomainName(unit);
+ output.setScopedInformation(scopedManagerName, domainName, sequence);
+ unit.getMutableMetaData().addAnnotation(output.getScopeAnnotation());
+ }
+
+ private String getDomainName(VFSDeploymentUnit unit)
+ {
+ Module module = unit.getTopLevel().getAttachment(Module.class);
+ if (module != null && !module.getDeterminedDomainName().equals(ClassLoaderSystem.DEFAULT_DOMAIN_NAME))
+ {
+ return module.getDeterminedDomainName();
+ }
+
+ return null;
+ }
+
+ private void deployBeans(VFSDeploymentUnit unit, AopMetaDataDeployerOutput output) throws DeploymentException
+ {
+ List<BeanMetaData> aopBeans = output.getBeans();
+ List<BeanMetaData> done = new ArrayList<BeanMetaData>();
+ try
+ {
+ if (aopBeans != null && aopBeans.size() > 0)
+ {
+ for (BeanMetaData bean : aopBeans)
+ {
+ //Register the component deployment context so we get the correct mutable metadata scope
+ //This has been replaced by a "fake" implementation to avoid the overhead of the real one
+ //which registers everything in JMX, which is pointless since we throw it away immediately
+ FakeComponentUnit componentUnit = deployComponentDeploymentContext(unit, bean);
+ try
+ {
+ beanMetaDataDeployer.deploy(componentUnit, bean);
+ done.add(bean);
+ }
+ finally
+ {
+ //Unregister the component deployment context so that this bean does not get deployed
+ //again by the real BeanMetaDataDeployer
+ undeployComponentDeploymentContext(componentUnit, bean);
+ }
+ }
+ }
+ }
+ catch (Throwable t)
+ {
+ for (int i = done.size() - 1 ; i >= 0 ; i--)
+ {
+ try
+ {
+ beanMetaDataDeployer.undeploy(unit, done.get(i));
+ controller.uninstall(done.get(i));
+ }
+ catch (Throwable e)
+ {
+ log.debug("Error undeploying " + done.get(i) + " for " + unit);
+ }
+ }
+ throw new DeploymentException(t);
+ }
+ }
+
+ private void undeployBeans(VFSDeploymentUnit unit, AopMetaDataDeployerOutput output)
+ {
+ if (output != null)
+ {
+ List<BeanMetaData> aopBeans = output.getBeans();
+ if (aopBeans != null && aopBeans.size() > 0)
+ {
+ for (int i = aopBeans.size() - 1 ; i >= 0 ; i--)
+ {
+ BeanMetaData bean = aopBeans.get(i);
+ beanMetaDataDeployer.undeploy(unit, bean);
+ }
+ }
+ }
+ }
+
+ /**
+ * Wrap the deployment unit in a component deployment unit similar to what the KernelDeploymentDeployer does
+ */
+ private FakeComponentUnit deployComponentDeploymentContext(VFSDeploymentUnit unit, BeanMetaData deployment)
+ {
+ //This used to make the following calls which has the overhead of registering the unit in JMX.
+ //All we really want are the scopes, which is handled by FakeComponentUnit
+// DeploymentUnit componentUnit = unit.addComponent(deployment.getName());
+// componentUnit.addAttachment(BeanMetaData.class.getName(), deployment);
+// return componentUnit;
+ return new FakeComponentUnit(unit, deployment);
+ }
+
+ /**
+ * Undeploy the component deployment unit similar to what the KernelDeploymentDeployer does
+ */
+ private void undeployComponentDeploymentContext(FakeComponentUnit unit, BeanMetaData bean)
+ {
+ unit.cleanup();
+ }
+
+ private class MyBeanMetaDataDeployer
+ {
+ /**
+ * Copied from the real org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer
+ */
+ private void deploy(FakeComponentUnit unit, BeanMetaData deployment) throws DeploymentException
+ {
+ // No explicit classloader, use the deployment's classloader
+ if (deployment.getClassLoader() == null)
+ {
+ try
+ {
+ // Check the unit has a classloader
+ unit.getClassLoader();
+ // TODO clone the metadata?
+ deployment.setClassLoader(new DeploymentClassLoaderMetaData(unit));
+ }
+ catch (Exception e)
+ {
+ log.debug("Unable to retrieve classloader for deployment: " + unit.getName() + " reason=" + e.toString());
+ }
+ }
+ KernelControllerContext context = new AbstractKernelControllerContext(null, deployment, null);
+ //Make sure that the metadata from the deployment gets put into the context
+ ScopeInfo scopeInfo = context.getScopeInfo();
+ if (scopeInfo != null)
+ {
+ mergeScopes(scopeInfo.getScope(), unit.getScope());
+ mergeScopes(scopeInfo.getMutableScope(), unit.getMutableScope());
+ }
+
+// KernelControllerContext context = new AbstractKernelControllerContext(null, deployment, null);
+// ScopeInfo scopeInfo2 = context.getScopeInfo();
+// if (scopeInfo2 != null)
+// {
+// ScopeKey key = unit.getScope().clone();
+// key.removeScopeLevel(CommonLevels.INSTANCE);
+// key.addScope(CommonLevels.INSTANCE, deployment.getName());
+//
+// ScopeKey mutable = new ScopeKey();
+// key.addScope(CommonLevels.INSTANCE, deployment.getName());
+//
+// mergeScopes(scopeInfo2.getScope(), key);
+// mergeScopes(scopeInfo2.getMutableScope(), mutable);
+// }
+
+ try
+ {
+ //System.out.println("==============> Installing " + context.getName());
+ controller.install(context);
+ }
+ catch (Throwable t)
+ {
+ throw DeploymentException.rethrowAsDeploymentException("Error deploying: " + deployment.getName(), t);
+ }
+
+
+ }
+
+ /**
+ * Copied from the real org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer
+ * Merge scope keys.
+ *
+ * @param contextKey the context key
+ * @param unitKey the unit key
+ */
+ protected void mergeScopes(ScopeKey contextKey, ScopeKey unitKey)
+ {
+ if (contextKey == null)
+ return;
+ if (unitKey == null)
+ return;
+
+ Collection<Scope> unitScopes = unitKey.getScopes();
+ if (unitScopes == null || unitScopes.isEmpty())
+ return;
+
+ for (Scope scope : unitScopes)
+ contextKey.addScope(scope);
+ }
+
+ /**
+ * Copied from the real org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer
+ */
+ private void undeploy(DeploymentUnit unit, BeanMetaData deployment)
+ {
+ try
+ {
+ controller.uninstall(deployment.getName());
+
+ // Remove any classloader metadata we added (not necessary if we clone above)
+ ClassLoaderMetaData classLoader = deployment.getClassLoader();
+ if (classLoader instanceof DeploymentClassLoaderMetaData)
+ deployment.setClassLoader(null);
+ }
+ catch(Throwable t)
+ {
+ log.info("Error undeploying " + deployment + " for " + unit);
+ }
+ }
+ }
+
+ /**
+ * Copied from BeanMetaDataDeployer
+ */
+ private static class DeploymentClassLoaderMetaData extends AbstractClassLoaderMetaData
+ {
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 1L;
+
+ /** The deployment unit */
+ private FakeComponentUnit unit;
+
+ /**
+ * Create a new DeploymentClassLoaderMetaData.
+ *
+ * @param unit the deployment unit
+ */
+ public DeploymentClassLoaderMetaData(FakeComponentUnit unit)
+ {
+ if (unit == null)
+ throw new IllegalArgumentException("Null unit");
+ this.unit = unit;
+ }
+
+ @Override
+ public ValueMetaData getClassLoader()
+ {
+ return new AbstractValueMetaData(unit.getClassLoader());
+ }
+ }
+
+ /**
+ * BeanMetaDatadeployer uses AbstractComponentUnit per bean, but that has the overhead of
+ * registering things in JMX. Create a Fake one here to encapsulate the methods that we use
+ * without registering things in JMX
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+ private static class FakeComponentUnit
+ {
+ VFSDeploymentUnit parent;
+ BeanMetaData bmd;
+ ScopeKey scope;
+ ScopeKey mutableScope;
+
+ FakeComponentUnit(VFSDeploymentUnit parent, BeanMetaData bmd)
+ {
+ this.parent = parent;
+ this.bmd = bmd;
+ }
+
+ ScopeKey getScope()
+ {
+ if (scope == null)
+ {
+ ScopeKey key = parent.getScope().clone();
+ key.removeScopeLevel(CommonLevels.INSTANCE);
+ key.addScope(CommonLevels.INSTANCE, bmd.getName());
+ }
+ return scope;
+ }
+
+ ScopeKey getMutableScope()
+ {
+ if (mutableScope == null)
+ {
+ mutableScope = new ScopeKey();
+ mutableScope.addScope(CommonLevels.INSTANCE, bmd.getName());
+ }
+ return mutableScope;
+ }
+
+ ClassLoader getClassLoader()
+ {
+ return parent.getClassLoader();
+ }
+
+ String getName()
+ {
+ return bmd.getName();
+ }
+
+ void cleanup()
+ {
+ MutableMetaDataRepository repository = null;
+ DeploymentUnit unit = parent;
+ while (repository == null && unit != null)
+ {
+ repository = unit.getAttachment(MutableMetaDataRepository.class);
+ unit = parent.getParent();
+ }
+ if (repository == null)
+ {
+ return;
+ }
+
+ try
+ {
+ ScopeKey scope = getScope();
+ repository.removeMetaDataRetrieval(scope);
+ }
+ catch (Throwable ignored)
+ {
+ }
+
+ try
+ {
+ ScopeKey scope = getMutableScope();
+ repository.removeMetaDataRetrieval(scope);
+ }
+ catch (Throwable ignored)
+ {
+ }
+ }
+ }
+}
Property changes on: trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/AbstractAopMetaDataDeployer.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/AliasesImpl.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/AliasesImpl.java 2008-11-14 14:46:22 UTC (rev 81043)
+++ trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/AliasesImpl.java 2008-11-14 14:49:09 UTC (rev 81044)
@@ -1,57 +1,57 @@
-/*
-* 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.aop.asintegration.jboss5;
-
-import java.lang.annotation.Annotation;
-
-import org.jboss.beans.metadata.api.annotations.Aliases;
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class AliasesImpl implements Aliases
-{
- String[] names;
-
- public AliasesImpl(String name)
- {
- super();
- this.names = new String[] {name};
- }
-
- public boolean replace()
- {
- return false;
- }
-
- public String[] value()
- {
- return names;
- }
-
- public Class<? extends Annotation> annotationType()
- {
- return Aliases.class;
- }
-
-}
+/*
+* 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.aop.asintegration.jboss5;
+
+import java.lang.annotation.Annotation;
+
+import org.jboss.beans.metadata.api.annotations.Aliases;
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class AliasesImpl implements Aliases
+{
+ String[] names;
+
+ public AliasesImpl(String name)
+ {
+ super();
+ this.names = new String[] {name};
+ }
+
+ public boolean replace()
+ {
+ return false;
+ }
+
+ public String[] value()
+ {
+ return names;
+ }
+
+ public Class<? extends Annotation> annotationType()
+ {
+ return Aliases.class;
+ }
+
+}
Property changes on: trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/AliasesImpl.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/AopMetaDataDeployerOutput.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/AopMetaDataDeployerOutput.java 2008-11-14 14:46:22 UTC (rev 81043)
+++ trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/AopMetaDataDeployerOutput.java 2008-11-14 14:49:09 UTC (rev 81044)
@@ -1,143 +1,143 @@
-/*
-* 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.aop.asintegration.jboss5;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import org.jboss.aop.microcontainer.beans.Aspect;
-import org.jboss.aop.microcontainer.beans.metadata.AspectManagerAwareBeanMetaDataFactory;
-import org.jboss.beans.metadata.spi.BeanMetaData;
-import org.jboss.beans.metadata.spi.PropertyMetaData;
-import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
-
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-class AopMetaDataDeployerOutput
-{
- List<AspectManagerAwareBeanMetaDataFactory> factories;
- List<BeanMetaData> beans;
- boolean scoped;
- String scopedAspectManagerBeanName;
- String domainName;
- int sequence;
- ClassLoaderDomainScope scopeAnnotation;
-
- AopMetaDataDeployerOutput()
- {
-
- }
-
- String getScopedAspectManagerBeanName()
- {
- return scopedAspectManagerBeanName;
- }
-
- ClassLoaderDomainScope getScopeAnnotation()
- {
- return scopeAnnotation;
- }
-
- void setFactories(List<AspectManagerAwareBeanMetaDataFactory> factories)
- {
- this.factories = factories;
- }
-
- void setScopedInformation(String scopedAspectManagerBeanName, String domainName, int sequence)
- {
- scoped = true;
- this.scopedAspectManagerBeanName = scopedAspectManagerBeanName;
- this.domainName = domainName;
- this.sequence = sequence;
- if (domainName == null)
- {
- throw new IllegalStateException("Should not have null domainName for scoped bean");
- }
- scopeAnnotation = new ClassLoaderDomainScopeImpl(domainName);
- }
-
- List<BeanMetaData> getBeans()
- {
- if (beans == null && factories != null && factories.size() > 0)
- {
- beans = new ArrayList<BeanMetaData>();
-
- for (AspectManagerAwareBeanMetaDataFactory factory : factories)
- {
- if (scopedAspectManagerBeanName != null)
- {
- factory.setManagerBean(scopedAspectManagerBeanName);
- factory.setManagerProperty(null);
- }
-
- List<BeanMetaData> mybeans = factory.getBeans();
- if (mybeans != null && mybeans.size() > 0)
- {
- for (BeanMetaData bean : mybeans)
- {
- massageScopedBean(bean);
- }
- beans.addAll(mybeans);
- }
- }
- }
- return beans;
- }
-
- private void massageScopedBean(BeanMetaData bean)
- {
- if (scoped)
- {
- String name = bean.getName();
- String newName = "ScopedAlias_" + sequence + "_" + name;
-
- BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder(bean);
-
- //Set the alias to the original name
- builder.addAnnotation(new AliasesImpl(name));
-
- //Set the domain name
- builder.addAnnotation(scopeAnnotation);
-
- //set the new name used by the controller for managing beans
- builder.setName(newName);
-
- //Debug stuff
- if (bean.getBean().equals(Aspect.class.getName()))
- {
- Object scope = null;
- Set<PropertyMetaData> properties = bean.getProperties();
- for (PropertyMetaData property : properties)
- {
- if (property.getName().equals("scope"))
- {
- scope = property.getValue().getUnderlyingValue();
- }
- }
- }
- }
- }
-}
+/*
+* 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.aop.asintegration.jboss5;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import org.jboss.aop.microcontainer.beans.Aspect;
+import org.jboss.aop.microcontainer.beans.metadata.AspectManagerAwareBeanMetaDataFactory;
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.beans.metadata.spi.PropertyMetaData;
+import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+class AopMetaDataDeployerOutput
+{
+ List<AspectManagerAwareBeanMetaDataFactory> factories;
+ List<BeanMetaData> beans;
+ boolean scoped;
+ String scopedAspectManagerBeanName;
+ String domainName;
+ int sequence;
+ ClassLoaderDomainScope scopeAnnotation;
+
+ AopMetaDataDeployerOutput()
+ {
+
+ }
+
+ String getScopedAspectManagerBeanName()
+ {
+ return scopedAspectManagerBeanName;
+ }
+
+ ClassLoaderDomainScope getScopeAnnotation()
+ {
+ return scopeAnnotation;
+ }
+
+ void setFactories(List<AspectManagerAwareBeanMetaDataFactory> factories)
+ {
+ this.factories = factories;
+ }
+
+ void setScopedInformation(String scopedAspectManagerBeanName, String domainName, int sequence)
+ {
+ scoped = true;
+ this.scopedAspectManagerBeanName = scopedAspectManagerBeanName;
+ this.domainName = domainName;
+ this.sequence = sequence;
+ if (domainName == null)
+ {
+ throw new IllegalStateException("Should not have null domainName for scoped bean");
+ }
+ scopeAnnotation = new ClassLoaderDomainScopeImpl(domainName);
+ }
+
+ List<BeanMetaData> getBeans()
+ {
+ if (beans == null && factories != null && factories.size() > 0)
+ {
+ beans = new ArrayList<BeanMetaData>();
+
+ for (AspectManagerAwareBeanMetaDataFactory factory : factories)
+ {
+ if (scopedAspectManagerBeanName != null)
+ {
+ factory.setManagerBean(scopedAspectManagerBeanName);
+ factory.setManagerProperty(null);
+ }
+
+ List<BeanMetaData> mybeans = factory.getBeans();
+ if (mybeans != null && mybeans.size() > 0)
+ {
+ for (BeanMetaData bean : mybeans)
+ {
+ massageScopedBean(bean);
+ }
+ beans.addAll(mybeans);
+ }
+ }
+ }
+ return beans;
+ }
+
+ private void massageScopedBean(BeanMetaData bean)
+ {
+ if (scoped)
+ {
+ String name = bean.getName();
+ String newName = "ScopedAlias_" + sequence + "_" + name;
+
+ BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder(bean);
+
+ //Set the alias to the original name
+ builder.addAnnotation(new AliasesImpl(name));
+
+ //Set the domain name
+ builder.addAnnotation(scopeAnnotation);
+
+ //set the new name used by the controller for managing beans
+ builder.setName(newName);
+
+ //Debug stuff
+ if (bean.getBean().equals(Aspect.class.getName()))
+ {
+ Object scope = null;
+ Set<PropertyMetaData> properties = bean.getProperties();
+ for (PropertyMetaData property : properties)
+ {
+ if (property.getName().equals("scope"))
+ {
+ scope = property.getValue().getUnderlyingValue();
+ }
+ }
+ }
+ }
+ }
+}
Property changes on: trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/AopMetaDataDeployerOutput.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/BeansDeploymentAopMetaDataDeployer.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/BeansDeploymentAopMetaDataDeployer.java 2008-11-14 14:46:22 UTC (rev 81043)
+++ trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/BeansDeploymentAopMetaDataDeployer.java 2008-11-14 14:49:09 UTC (rev 81044)
@@ -1,62 +1,62 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, Red Hat Middleware LLC., 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.asintegration.jboss5;
-
-import java.util.List;
-
-import org.jboss.beans.metadata.spi.BeanMetaDataFactory;
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
-import org.jboss.kernel.spi.deployment.KernelDeployment;
-
-/**
- * Deployer for Aspects in a -beans.xml
- *
- * @author <a href="mailto:kabir.khan at jboss.org">Kabir Khan</a>
- */
-public class BeansDeploymentAopMetaDataDeployer extends AbstractAopMetaDataDeployer<KernelDeployment>
-{
- public BeansDeploymentAopMetaDataDeployer()
- {
- super(KernelDeployment.class);
- }
-
- @Override
- public void deploy(VFSDeploymentUnit unit, KernelDeployment kernelDeployment) throws DeploymentException
- {
- super.deploy(unit, kernelDeployment);
- }
-
- @Override
- public void undeploy(VFSDeploymentUnit unit, KernelDeployment kernelDeployment)
- {
- super.undeploy(unit, kernelDeployment);
- }
-
-
- @Override
- protected List<BeanMetaDataFactory> getFactories(KernelDeployment kernelDeployment)
- {
- return kernelDeployment.getBeanFactories();
- }
-
-}
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, Red Hat Middleware LLC., 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.asintegration.jboss5;
+
+import java.util.List;
+
+import org.jboss.beans.metadata.spi.BeanMetaDataFactory;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.kernel.spi.deployment.KernelDeployment;
+
+/**
+ * Deployer for Aspects in a -beans.xml
+ *
+ * @author <a href="mailto:kabir.khan at jboss.org">Kabir Khan</a>
+ */
+public class BeansDeploymentAopMetaDataDeployer extends AbstractAopMetaDataDeployer<KernelDeployment>
+{
+ public BeansDeploymentAopMetaDataDeployer()
+ {
+ super(KernelDeployment.class);
+ }
+
+ @Override
+ public void deploy(VFSDeploymentUnit unit, KernelDeployment kernelDeployment) throws DeploymentException
+ {
+ super.deploy(unit, kernelDeployment);
+ }
+
+ @Override
+ public void undeploy(VFSDeploymentUnit unit, KernelDeployment kernelDeployment)
+ {
+ super.undeploy(unit, kernelDeployment);
+ }
+
+
+ @Override
+ protected List<BeanMetaDataFactory> getFactories(KernelDeployment kernelDeployment)
+ {
+ return kernelDeployment.getBeanFactories();
+ }
+
+}
Property changes on: trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/BeansDeploymentAopMetaDataDeployer.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/ClassLoaderDomainScope.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/ClassLoaderDomainScope.java 2008-11-14 14:46:22 UTC (rev 81043)
+++ trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/ClassLoaderDomainScope.java 2008-11-14 14:49:09 UTC (rev 81044)
@@ -1,42 +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.aop.asintegration.jboss5;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-import org.jboss.metadata.spi.scope.ScopeFactoryLookup;
-
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
- at ScopeFactoryLookup(ClassLoaderDomainScopeFactory.class)
- at Retention(RetentionPolicy.RUNTIME)
- at Target({ElementType.TYPE})
-public @interface ClassLoaderDomainScope
-{
- String value();
-}
+/*
+* 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.aop.asintegration.jboss5;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.jboss.metadata.spi.scope.ScopeFactoryLookup;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+ at ScopeFactoryLookup(ClassLoaderDomainScopeFactory.class)
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target({ElementType.TYPE})
+public @interface ClassLoaderDomainScope
+{
+ String value();
+}
Property changes on: trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/ClassLoaderDomainScope.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/ClassLoaderDomainScopeFactory.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/ClassLoaderDomainScopeFactory.java 2008-11-14 14:46:22 UTC (rev 81043)
+++ trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/ClassLoaderDomainScopeFactory.java 2008-11-14 14:49:09 UTC (rev 81044)
@@ -1,41 +1,41 @@
-/*
-* 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.aop.asintegration.jboss5;
-
-import org.jboss.metadata.spi.scope.CommonLevels;
-import org.jboss.metadata.spi.scope.Scope;
-import org.jboss.metadata.spi.scope.ScopeFactory;
-import org.jboss.metadata.spi.scope.ScopeLevel;
-
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class ClassLoaderDomainScopeFactory implements ScopeFactory<ClassLoaderDomainScope>
-{
- public Scope create(ClassLoaderDomainScope annotation)
- {
- return new Scope(new ScopeLevel(CommonLevels.APPLICATION.getLevel() + 10, "ClassLoaderDomainScope"), annotation.value());
- }
-
-}
+/*
+* 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.aop.asintegration.jboss5;
+
+import org.jboss.metadata.spi.scope.CommonLevels;
+import org.jboss.metadata.spi.scope.Scope;
+import org.jboss.metadata.spi.scope.ScopeFactory;
+import org.jboss.metadata.spi.scope.ScopeLevel;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class ClassLoaderDomainScopeFactory implements ScopeFactory<ClassLoaderDomainScope>
+{
+ public Scope create(ClassLoaderDomainScope annotation)
+ {
+ return new Scope(new ScopeLevel(CommonLevels.APPLICATION.getLevel() + 10, "ClassLoaderDomainScope"), annotation.value());
+ }
+
+}
Property changes on: trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/ClassLoaderDomainScopeFactory.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/ClassLoaderDomainScopeImpl.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/ClassLoaderDomainScopeImpl.java 2008-11-14 14:46:22 UTC (rev 81043)
+++ trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/ClassLoaderDomainScopeImpl.java 2008-11-14 14:49:09 UTC (rev 81044)
@@ -1,50 +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.aop.asintegration.jboss5;
-
-import java.lang.annotation.Annotation;
-
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class ClassLoaderDomainScopeImpl implements ClassLoaderDomainScope
-{
- String name;
-
- public ClassLoaderDomainScopeImpl(String name)
- {
- this.name = name;
- }
-
- public String value()
- {
- return name;
- }
-
- public Class<? extends Annotation> annotationType()
- {
- return ClassLoaderDomainScope.class;
- }
-
-}
+/*
+* 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.aop.asintegration.jboss5;
+
+import java.lang.annotation.Annotation;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class ClassLoaderDomainScopeImpl implements ClassLoaderDomainScope
+{
+ String name;
+
+ public ClassLoaderDomainScopeImpl(String name)
+ {
+ this.name = name;
+ }
+
+ public String value()
+ {
+ return name;
+ }
+
+ public Class<? extends Annotation> annotationType()
+ {
+ return ClassLoaderDomainScope.class;
+ }
+
+}
Property changes on: trunk/aspects/src/main/org/jboss/aop/asintegration/jboss5/ClassLoaderDomainScopeImpl.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/aspects/src/main/org/jboss/aspects/library/JBossAspectLibrary.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/library/JBossAspectLibrary.java 2008-11-14 14:46:22 UTC (rev 81043)
+++ trunk/aspects/src/main/org/jboss/aspects/library/JBossAspectLibrary.java 2008-11-14 14:49:09 UTC (rev 81044)
@@ -1,84 +1,84 @@
-/*
-* 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.aspects.library;
-
-import org.jboss.aop.deployers.AbstractAspectManager;
-import org.jboss.logging.Logger;
-
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class JBossAspectLibrary
-{
- private static final Logger log = Logger.getLogger(JBossAspectLibrary.class);
- AbstractAspectManager aspectManager;
-
- public AbstractAspectManager getAspectManager()
- {
- return aspectManager;
- }
-
- public void setAspectManager(AbstractAspectManager aspectManagerBean)
- {
- this.aspectManager = aspectManagerBean;
- }
-
- /**
- * @throws Exception
- * @see org.jboss.system.ServiceMBeanSupport#start()
- */
- public void start() throws Exception
- {
- //Use the loader of this class so that we can find base-aspects.xml in the resources
- //using the new loaders
- ClassLoader tcl = SecurityActions.getThreadContextClassLoader();
- try
- {
- ClassLoader mycl = SecurityActions.getClassLoader(this.getClass());
- SecurityActions.setThreadContextClassLoader(mycl);
- aspectManager.deployBaseAspects();
- }
- finally
- {
- SecurityActions.setThreadContextClassLoader(tcl);
- }
- }
-
- public void stop()
- {
- //Use the loader of this class so that we can find base-aspects.xml in the resources
- //using the new loaders
- ClassLoader tcl = SecurityActions.getThreadContextClassLoader();
- try
- {
- ClassLoader mycl = SecurityActions.getClassLoader(this.getClass());
- SecurityActions.setThreadContextClassLoader(mycl);
- aspectManager.undeployBaseAspects();
- }
- finally
- {
- SecurityActions.setThreadContextClassLoader(tcl);
- }
- }
-}
+/*
+* 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.aspects.library;
+
+import org.jboss.aop.deployers.AbstractAspectManager;
+import org.jboss.logging.Logger;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class JBossAspectLibrary
+{
+ private static final Logger log = Logger.getLogger(JBossAspectLibrary.class);
+ AbstractAspectManager aspectManager;
+
+ public AbstractAspectManager getAspectManager()
+ {
+ return aspectManager;
+ }
+
+ public void setAspectManager(AbstractAspectManager aspectManagerBean)
+ {
+ this.aspectManager = aspectManagerBean;
+ }
+
+ /**
+ * @throws Exception
+ * @see org.jboss.system.ServiceMBeanSupport#start()
+ */
+ public void start() throws Exception
+ {
+ //Use the loader of this class so that we can find base-aspects.xml in the resources
+ //using the new loaders
+ ClassLoader tcl = SecurityActions.getThreadContextClassLoader();
+ try
+ {
+ ClassLoader mycl = SecurityActions.getClassLoader(this.getClass());
+ SecurityActions.setThreadContextClassLoader(mycl);
+ aspectManager.deployBaseAspects();
+ }
+ finally
+ {
+ SecurityActions.setThreadContextClassLoader(tcl);
+ }
+ }
+
+ public void stop()
+ {
+ //Use the loader of this class so that we can find base-aspects.xml in the resources
+ //using the new loaders
+ ClassLoader tcl = SecurityActions.getThreadContextClassLoader();
+ try
+ {
+ ClassLoader mycl = SecurityActions.getClassLoader(this.getClass());
+ SecurityActions.setThreadContextClassLoader(mycl);
+ aspectManager.undeployBaseAspects();
+ }
+ finally
+ {
+ SecurityActions.setThreadContextClassLoader(tcl);
+ }
+ }
+}
Property changes on: trunk/aspects/src/main/org/jboss/aspects/library/JBossAspectLibrary.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/aspects/src/main/org/jboss/aspects/library/SecurityActions.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/library/SecurityActions.java 2008-11-14 14:46:22 UTC (rev 81043)
+++ trunk/aspects/src/main/org/jboss/aspects/library/SecurityActions.java 2008-11-14 14:49:09 UTC (rev 81044)
@@ -1,148 +1,148 @@
-/*
-* 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.aspects.library;
-
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-/**
- *
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-class SecurityActions
-{
- interface SetTcl
- {
- void setContextClassLoader(ClassLoader loader);
-
- SetTcl PRIVILEGED = new SetTcl() {
-
- public void setContextClassLoader(final ClassLoader loader)
- {
- AccessController.doPrivileged(new PrivilegedAction() {
-
- public Object run()
- {
- Thread.currentThread().setContextClassLoader(loader);
- return null;
- }});
- }
- };
-
- SetTcl NON_PRIVILEGED = new SetTcl() {
-
- public void setContextClassLoader(ClassLoader loader)
- {
- Thread.currentThread().setContextClassLoader(loader);
- }
- };
- }
-
- interface GetTcl
- {
- ClassLoader getContextClassLoader();
-
- GetTcl PRIVILEGED = new GetTcl() {
-
- public ClassLoader getContextClassLoader()
- {
- return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
-
- public ClassLoader run()
- {
- return Thread.currentThread().getContextClassLoader();
- }});
- }
- };
-
- GetTcl NON_PRIVILEGED = new GetTcl() {
-
- public ClassLoader getContextClassLoader()
- {
- return Thread.currentThread().getContextClassLoader();
- }
- };
- }
-
- interface GetClassLoader
- {
- ClassLoader getClassLoader(Class clazz);
-
- GetClassLoader PRIVILEGED = new GetClassLoader() {
-
- public ClassLoader getClassLoader(final Class clazz)
- {
- return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
-
- public ClassLoader run()
- {
- return clazz.getClassLoader();
- }});
- }
- };
-
- GetClassLoader NON_PRIVILEGED = new GetClassLoader() {
-
- public ClassLoader getClassLoader(Class clazz)
- {
- return clazz.getClassLoader();
- }
- };
- }
-
- public static void setThreadContextClassLoader(ClassLoader loader)
- {
- if (System.getSecurityManager() == null)
- {
- SetTcl.NON_PRIVILEGED.setContextClassLoader(loader);
- }
- else
- {
- SetTcl.PRIVILEGED.setContextClassLoader(loader);
- }
- }
-
- public static ClassLoader getThreadContextClassLoader()
- {
- if (System.getSecurityManager() == null)
- {
- return GetTcl.NON_PRIVILEGED.getContextClassLoader();
- }
- else
- {
- return GetTcl.PRIVILEGED.getContextClassLoader();
- }
- }
-
- public static ClassLoader getClassLoader(Class clazz)
- {
- if (System.getSecurityManager() == null)
- {
- return GetClassLoader.NON_PRIVILEGED.getClassLoader(clazz);
- }
- else
- {
- return GetClassLoader.PRIVILEGED.getClassLoader(clazz);
- }
- }
-}
+/*
+* 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.aspects.library;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+/**
+ *
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+class SecurityActions
+{
+ interface SetTcl
+ {
+ void setContextClassLoader(ClassLoader loader);
+
+ SetTcl PRIVILEGED = new SetTcl() {
+
+ public void setContextClassLoader(final ClassLoader loader)
+ {
+ AccessController.doPrivileged(new PrivilegedAction() {
+
+ public Object run()
+ {
+ Thread.currentThread().setContextClassLoader(loader);
+ return null;
+ }});
+ }
+ };
+
+ SetTcl NON_PRIVILEGED = new SetTcl() {
+
+ public void setContextClassLoader(ClassLoader loader)
+ {
+ Thread.currentThread().setContextClassLoader(loader);
+ }
+ };
+ }
+
+ interface GetTcl
+ {
+ ClassLoader getContextClassLoader();
+
+ GetTcl PRIVILEGED = new GetTcl() {
+
+ public ClassLoader getContextClassLoader()
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
+
+ public ClassLoader run()
+ {
+ return Thread.currentThread().getContextClassLoader();
+ }});
+ }
+ };
+
+ GetTcl NON_PRIVILEGED = new GetTcl() {
+
+ public ClassLoader getContextClassLoader()
+ {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ };
+ }
+
+ interface GetClassLoader
+ {
+ ClassLoader getClassLoader(Class clazz);
+
+ GetClassLoader PRIVILEGED = new GetClassLoader() {
+
+ public ClassLoader getClassLoader(final Class clazz)
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
+
+ public ClassLoader run()
+ {
+ return clazz.getClassLoader();
+ }});
+ }
+ };
+
+ GetClassLoader NON_PRIVILEGED = new GetClassLoader() {
+
+ public ClassLoader getClassLoader(Class clazz)
+ {
+ return clazz.getClassLoader();
+ }
+ };
+ }
+
+ public static void setThreadContextClassLoader(ClassLoader loader)
+ {
+ if (System.getSecurityManager() == null)
+ {
+ SetTcl.NON_PRIVILEGED.setContextClassLoader(loader);
+ }
+ else
+ {
+ SetTcl.PRIVILEGED.setContextClassLoader(loader);
+ }
+ }
+
+ public static ClassLoader getThreadContextClassLoader()
+ {
+ if (System.getSecurityManager() == null)
+ {
+ return GetTcl.NON_PRIVILEGED.getContextClassLoader();
+ }
+ else
+ {
+ return GetTcl.PRIVILEGED.getContextClassLoader();
+ }
+ }
+
+ public static ClassLoader getClassLoader(Class clazz)
+ {
+ if (System.getSecurityManager() == null)
+ {
+ return GetClassLoader.NON_PRIVILEGED.getClassLoader(clazz);
+ }
+ else
+ {
+ return GetClassLoader.PRIVILEGED.getClassLoader(clazz);
+ }
+ }
+}
Property changes on: trunk/aspects/src/main/org/jboss/aspects/library/SecurityActions.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/aspects/src/main/org/jboss/aspects/remoting/DispatcherRegistration.java
===================================================================
--- trunk/aspects/src/main/org/jboss/aspects/remoting/DispatcherRegistration.java 2008-11-14 14:46:22 UTC (rev 81043)
+++ trunk/aspects/src/main/org/jboss/aspects/remoting/DispatcherRegistration.java 2008-11-14 14:49:09 UTC (rev 81044)
@@ -1,67 +1,67 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, 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.aspects.remoting;
-
-import org.jboss.aop.Dispatcher;
-
-/**
- * comment
- *
- * @author <a href="bill at jboss.com">Bill Burke</a>
- * @version $Revision: 1.1 $
- */
-public class DispatcherRegistration
-{
- private Object oid;
- private Object target;
-
-
- public Object getOid()
- {
- return oid;
- }
-
- public void setOid(Object oid)
- {
- this.oid = oid;
- }
-
- public Object getTarget()
- {
- return target;
- }
-
- public void setTarget(Object target)
- {
- this.target = target;
- }
-
- public void start()
- {
- Dispatcher.singleton.registerTarget(oid, target);
- }
-
- public void stop()
- {
- Dispatcher.singleton.unregisterTarget(oid);
- }
-}
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.aspects.remoting;
+
+import org.jboss.aop.Dispatcher;
+
+/**
+ * comment
+ *
+ * @author <a href="bill at jboss.com">Bill Burke</a>
+ * @version $Revision: 1.1 $
+ */
+public class DispatcherRegistration
+{
+ private Object oid;
+ private Object target;
+
+
+ public Object getOid()
+ {
+ return oid;
+ }
+
+ public void setOid(Object oid)
+ {
+ this.oid = oid;
+ }
+
+ public Object getTarget()
+ {
+ return target;
+ }
+
+ public void setTarget(Object target)
+ {
+ this.target = target;
+ }
+
+ public void start()
+ {
+ Dispatcher.singleton.registerTarget(oid, target);
+ }
+
+ public void stop()
+ {
+ Dispatcher.singleton.unregisterTarget(oid);
+ }
+}
Property changes on: trunk/aspects/src/main/org/jboss/aspects/remoting/DispatcherRegistration.java
___________________________________________________________________
Name: svn:eol-style
+ native
More information about the jboss-cvs-commits
mailing list